X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b258d5c9c0df493362e405852089a923e5f450e6..94cee0547a96ae874c04f2435c9e326c5a3f474e:/src/kernel/routing/TorusZone_test.cpp diff --git a/src/kernel/routing/TorusZone_test.cpp b/src/kernel/routing/TorusZone_test.cpp index a33a15c53e..cdaf1981d1 100644 --- a/src/kernel/routing/TorusZone_test.cpp +++ b/src/kernel/routing/TorusZone_test.cpp @@ -5,25 +5,14 @@ #include "catch.hpp" -#include "simgrid/kernel/routing/NetPoint.hpp" +#include "NetZone_test.hpp" // CreateHost callback #include "simgrid/kernel/routing/TorusZone.hpp" #include "simgrid/s4u/Engine.hpp" -#include "simgrid/s4u/Host.hpp" -#include "simgrid/s4u/NetZone.hpp" - -namespace { -std::pair -create_host(simgrid::s4u::NetZone* zone, const std::vector& /*coord*/, int id) -{ - const simgrid::s4u::Host* host = zone->create_host(std::to_string(id), 1e9)->seal(); - return std::make_pair(host->get_netpoint(), nullptr); -} -} // namespace TEST_CASE("kernel::routing::TorusZone: Creating Zone", "") { simgrid::s4u::Engine e("test"); - simgrid::s4u::ClusterCallbacks callbacks(create_host); + simgrid::s4u::ClusterCallbacks callbacks(CreateHost{}); REQUIRE(create_torus_zone("test", e.get_netzone_root(), {3, 3, 3}, callbacks, 1e9, 10, simgrid::s4u::Link::SharingPolicy::SHARED)); } @@ -31,7 +20,7 @@ TEST_CASE("kernel::routing::TorusZone: Creating Zone", "") TEST_CASE("kernel::routing::TorusZone: Invalid params", "") { simgrid::s4u::Engine e("test"); - simgrid::s4u::ClusterCallbacks callbacks(create_host); + simgrid::s4u::ClusterCallbacks callbacks(CreateHost{}); SECTION("Empty dimensions") {