From: Bruno Donassolo Date: Mon, 31 May 2021 17:22:28 +0000 (+0200) Subject: Fixes in UTs X-Git-Tag: v3.28~191 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a1b891dc26d75c259f8080da805bebe7ff5f76f6 Fixes in UTs --- diff --git a/src/kernel/resource/NetworkModelIntf_test.cpp b/src/kernel/resource/NetworkModelIntf_test.cpp index e7c8460c53..de99706444 100644 --- a/src/kernel/resource/NetworkModelIntf_test.cpp +++ b/src/kernel/resource/NetworkModelIntf_test.cpp @@ -17,7 +17,13 @@ static double factor_cb(double, const simgrid::s4u::Host*, const simgrid::s4u::H TEST_CASE("kernel::resource::NetworkModelIntf: Factors invalid callbacks: exception", "") { - for (const auto& model : std::vector{"LV08", "SMPI", "IB", "CM02"}) { + std::vector models{"LV08", "CM02"}; +#if HAVE_SMPI + models.push_back("SMPI"); + models.push_back("IB"); +#endif + + for (const auto& model : models) { _sg_cfg_init_status = 0; /* HACK: clear config global to be able to do set_config in UTs */ simgrid::s4u::Engine e("test"); simgrid::s4u::Engine::set_config("network/model:" + model); @@ -53,6 +59,7 @@ TEST_CASE("kernel::resource::NetworkModelIntf: Invalid network/latency-factor an } } +#if HAVE_SMPI TEST_CASE("kernel::resource::NetworkModelIntf: Invalid smpi/lat-factor and smpi/bw-factor", "") { for (const auto& model : std::vector{"SMPI", "IB"}) { @@ -72,3 +79,4 @@ TEST_CASE("kernel::resource::NetworkModelIntf: Invalid smpi/lat-factor and smpi/ } } } +#endif \ No newline at end of file diff --git a/src/kernel/routing/StarZone_test.cpp b/src/kernel/routing/StarZone_test.cpp index d3967a9c59..d8d5206235 100644 --- a/src/kernel/routing/StarZone_test.cpp +++ b/src/kernel/routing/StarZone_test.cpp @@ -50,7 +50,7 @@ TEST_CASE("kernel::routing::StarZone: Adding routes (netzones): exception", "") new simgrid::kernel::routing::NetPoint("netpoint1", simgrid::kernel::routing::NetPoint::Type::NetZone); auto* netpoint2 = new simgrid::kernel::routing::NetPoint("netpoint2", simgrid::kernel::routing::NetPoint::Type::NetZone); - auto* zone3 = new simgrid::kernel::routing::StarZone("test3"); + auto zone3 = std::make_unique("test3"); auto* netpoint3 = zone3->create_router("netpoint3"); SECTION("src: is a netzone and gw_src: nullptr")