Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / teshsuite / simdag / basic6 / basic6.c
index 204e55a..7d42df7 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012, 2014-2015. The SimGrid Team.
+/* Copyright (c) 2007-2020. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
 {
   double comm_cost[] = { 0.0, 0.0, 0.0, 0.0 };
   double comp_cost[] = { 1.0 };
-  xbt_dynar_t ret;
+  xbt_dynar_t ret    = xbt_dynar_new(sizeof(SD_task_t), NULL);
 
   SD_init(&argc, argv);
   SD_create_environment(argv[1]);
@@ -37,14 +37,14 @@ int main(int argc, char **argv)
   SD_task_schedule(taskB, 1, hosts, comp_cost, comm_cost, -1.0);
   xbt_free(hosts);
 
-  ret = SD_simulate(-1.0);
+  SD_simulate_with_update(-1.0, ret);
   xbt_assert(xbt_dynar_length(ret) == 2, "I was expecting the completion of 2 tasks, but I got %lu instead",
              xbt_dynar_length(ret));
   SD_task_destroy(taskA);
   SD_task_destroy(taskB);
+  xbt_dynar_free(&ret);
 
   XBT_INFO("Simulation time: %f", SD_get_clock());
 
-  SD_exit();
   return 0;
 }