Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / resource / profile / Profile_test.cpp
index 8d4671a..bb5960d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2017-2021. 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. */
@@ -6,9 +6,8 @@
 #include "catch.hpp"
 
 #include "src/kernel/resource/Resource.hpp"
-#include "src/kernel/resource/profile/DatedValue.hpp"
 #include "src/kernel/resource/profile/Event.hpp"
-#include "src/kernel/resource/profile/Profile.hpp"
+#include "simgrid/kernel/ProfileBuilder.hpp"
 #include "src/kernel/resource/profile/StochasticDatedValue.hpp"
 #include "src/surf/surf_interface.hpp"
 
@@ -38,7 +37,7 @@ double MockedResource::the_date;
 static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char* str)
 {
   std::vector<simgrid::kernel::profile::DatedValue> res;
-  simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::Profile::from_string("TheName", str, 0);
+  simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::ProfileBuilder::from_string("TheName", str, 0);
   XBT_VERB("---------------------------------------------------------");
   XBT_VERB("data>>\n%s<<data\n", str);
   for (auto const& evt : trace->get_event_list())
@@ -68,14 +67,6 @@ static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char
   return res;
 }
 
-static std::vector<simgrid::kernel::profile::StochasticDatedValue> trace2selist(const char* str)
-{
-  const simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::Profile::from_string("TheName", str, 0);
-  std::vector<simgrid::kernel::profile::StochasticDatedValue> stocevlist = trace->get_stochastic_event_list();
-  tmgr_finalize();
-  return stocevlist;
-}
-
 TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
 {
   SECTION("No event, no loop")
@@ -162,7 +153,6 @@ TEST_CASE("kernel::profile: Resource profiles, defining the external load", "ker
                                                                                    "DET 0 UNIF 10 20");
 
     std::vector<simgrid::kernel::profile::StochasticDatedValue> want;
-    want.emplace_back(0, -1); // The initial fake event
     want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::UNIF, std::vector<double>{10, 20});
 
     REQUIRE(want == got);
@@ -178,7 +168,6 @@ TEST_CASE("kernel::profile: Resource profiles, defining the external load", "ker
                                                                                    "DET 5 UNIF 5 25");
 
     std::vector<simgrid::kernel::profile::StochasticDatedValue> want;
-    want.emplace_back(0, -1);
     want.emplace_back(Distribution::DET, std::vector<double>{0}, Distribution::DET, std::vector<double>{4});
     want.emplace_back(Distribution::NORM, std::vector<double>{25, 10}, Distribution::DET, std::vector<double>{3});
     want.emplace_back(Distribution::UNIF, std::vector<double>{10, 20}, Distribution::NORM, std::vector<double>{25, 10});