Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / teshsuite / s4u / activity-lifecycle / activity-lifecycle.cpp
index 2fde68e..c0843c6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2019. 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. */
@@ -204,7 +204,7 @@ static void test_comm_killsend()
 /* We need an extra actor here, so that it can sleep until the end of each test */
 static void main_dispatcher()
 {
-  run_test("sleep", test_sleep);
+  run_test("sleep", static_cast<std::function<void()>>(test_sleep));
   run_test("sleep killed at start", test_sleep_kill_begin);
   run_test("sleep killed in middle", test_sleep_kill_middle);
   /* We cannot kill right at the end of the action because killer actors are always rescheduled to the end of the round
@@ -220,8 +220,13 @@ static void main_dispatcher()
 int main(int argc, char* argv[])
 {
   simgrid::s4u::Engine e(&argc, argv);
-  xbt_assert(argc > 1);
-  e.load_platform(argv[1]);
+
+  const char* platf = argv[1];
+  if (argc <= 1) {
+    XBT_WARN("No platform file provided. Using './testing_platform.xml'");
+    platf = "./testing_platform.xml";
+  }
+  e.load_platform(platf);
 
   all_hosts = e.get_all_hosts();
   simgrid::s4u::Actor::create("main_dispatcher", all_hosts[0], main_dispatcher);