Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Provide our own main() for unit-tests.
[simgrid.git] / src / kernel / resource / profile / trace_mgr_test.cpp
index 5392035..de942e2 100644 (file)
@@ -3,8 +3,7 @@
 /* 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. */
 
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
-#include "src/include/catch.hpp"
+#include "catch.hpp"
 
 #include "simgrid/kernel/resource/Resource.hpp"
 #include "src/kernel/resource/profile/trace_mgr.hpp"
@@ -32,8 +31,7 @@ public:
 static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char* str)
 {
   std::vector<simgrid::kernel::profile::DatedValue> res;
-
-  simgrid::kernel::profile::Profile* trace = tmgr_trace_new_from_string("TheName", str, 0);
+  simgrid::kernel::profile::Profile* trace = simgrid::kernel::profile::Profile::from_string("TheName", str, 0);
   XBT_VERB("---------------------------------------------------------");
   XBT_VERB("data>>\n%s<<data\n", str);
   for (auto const& evt : trace->event_list)
@@ -41,7 +39,7 @@ static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char
 
   MockedResource daResource;
   simgrid::kernel::profile::FutureEvtSet fes;
-  simgrid::kernel::profile::Event* insertedIt = fes.add_trace(trace, &daResource);
+  simgrid::kernel::profile::Event* insertedIt = trace->schedule(&fes, &daResource);
 
   while (fes.next_date() <= 20.0 && fes.next_date() >= 0) {
     thedate = fes.next_date();
@@ -63,9 +61,6 @@ static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char
   return res;
 }
 
-/* Fails in a way that is difficult to test: xbt_assert should become throw
-BOOST_AUTO_TEST_CASE(no_evt_noloop) {
-}*/
 TEST_CASE("kernel::profile: Resource profiles, defining the external load", "kernel::profile")
 {