Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix tesh with new dependencies on Mutex
[simgrid.git] / teshsuite / s4u / basic-link-test / basic-link-test.cpp
index a2b8bf4..8466f44 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2020. The SimGrid Team.
+/* Copyright (c) 2008-2023. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -19,7 +19,7 @@ int main(int argc, char** argv)
   /* creation of the environment */
   e.load_platform(argv[1]);
 
-  std::vector<simgrid::s4u::Link*> links = simgrid::s4u::Engine::get_instance()->get_all_links();
+  std::vector<simgrid::s4u::Link*> links = e.get_all_links();
   XBT_INFO("Link count: %zu", links.size());
 
   std::sort(links.begin(), links.end(), [](const simgrid::s4u::Link* a, const simgrid::s4u::Link* b) {
@@ -29,7 +29,7 @@ int main(int argc, char** argv)
   for (const auto& l : links) {
     XBT_INFO("%s: latency = %.5f, bandwidth = %f", l->get_cname(), l->get_latency(), l->get_bandwidth());
     l->set_data(&user_data);
-    xbt_assert(user_data == *static_cast<const std::string*>(l->get_data()), "User data was corrupted.");
+    xbt_assert(user_data == *l->get_data<std::string>(), "User data was corrupted.");
   }
 
   return 0;