-/* Copyright (c) 2017-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2017-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-#include "catch.hpp"
+#include "src/3rd-party/catch.hpp"
#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/sg_config.hpp"
#include "src/internal_config.h" // HAVE_SMPI
#include "src/kernel/resource/NetworkModelFactors.hpp"
+#include "src/simgrid/sg_config.hpp"
static double factor_cb(double, const simgrid::s4u::Host*, const simgrid::s4u::Host*,
const std::vector<simgrid::s4u::Link*>&, const std::unordered_set<simgrid::s4u::NetZone*>&)
return 1.0;
}
-TEST_CASE("kernel::resource::NetworkModelIntf: Factors invalid callbacks: exception", "")
+TEST_CASE("kernel::resource::NetworkModelFactors: Factors invalid callbacks: exception", "")
{
std::vector<std::string> models{"LV08", "CM02"};
#if HAVE_SMPI
SECTION("Model: " + model)
{
- simgrid::kernel::resource::NetworkModelIntf* m = e.get_netzone_root()->get_network_model();
- REQUIRE_THROWS_AS(m->set_lat_factor_cb({}), std::invalid_argument);
- REQUIRE_THROWS_AS(m->set_lat_factor_cb(nullptr), std::invalid_argument);
- REQUIRE_THROWS_AS(m->set_bw_factor_cb({}), std::invalid_argument);
- REQUIRE_THROWS_AS(m->set_bw_factor_cb(nullptr), std::invalid_argument);
+ const auto* zone = e.get_netzone_root();
+ REQUIRE_THROWS_AS(zone->set_latency_factor_cb({}), std::invalid_argument);
+ REQUIRE_THROWS_AS(zone->set_latency_factor_cb(nullptr), std::invalid_argument);
+ REQUIRE_THROWS_AS(zone->set_bandwidth_factor_cb({}), std::invalid_argument);
+ REQUIRE_THROWS_AS(zone->set_bandwidth_factor_cb(nullptr), std::invalid_argument);
}
}
}
-TEST_CASE("kernel::resource::NetworkModelIntf: Invalid network/latency-factor and network/bandwidth-factor", "")
+TEST_CASE("kernel::resource::NetworkModelFactors: Invalid network/latency-factor and network/bandwidth-factor", "")
{
std::vector<std::string> models{"LV08", "CM02"};
#if HAVE_SMPI
SECTION("Model: " + model)
{
- simgrid::kernel::resource::NetworkModelIntf* m = e.get_netzone_root()->get_network_model();
- REQUIRE_THROWS_AS(m->set_lat_factor_cb(factor_cb), std::invalid_argument);
- REQUIRE_THROWS_AS(m->set_bw_factor_cb(factor_cb), std::invalid_argument);
+ const auto* zone = e.get_netzone_root();
+ REQUIRE_THROWS_AS(zone->set_latency_factor_cb(factor_cb), std::invalid_argument);
+ REQUIRE_THROWS_AS(zone->set_bandwidth_factor_cb(factor_cb), std::invalid_argument);
}
}
}