Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines.
[simgrid.git] / examples / s4u / trace-host-user-variables / s4u-trace-host-user-variables.cpp
index 8d64839..b0546e0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2010-2021. 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. */
@@ -54,11 +54,11 @@ int main(int argc, char* argv[])
   e.run();
 
   // get user declared variables
-  unsigned int cursor;
-  char* variable;
   xbt_dynar_t host_variables = TRACE_get_host_variables();
   if (host_variables) {
     XBT_INFO("Declared host variables:");
+    unsigned int cursor;
+    char* variable;
     xbt_dynar_foreach (host_variables, cursor, variable) {
       XBT_INFO("%s", variable);
     }
@@ -66,10 +66,7 @@ int main(int argc, char* argv[])
   }
   xbt_dynar_t link_variables = TRACE_get_link_variables();
   if (link_variables) {
-    XBT_INFO("Declared link variables:");
-    xbt_dynar_foreach (link_variables, cursor, variable) {
-      XBT_INFO("%s", variable);
-    }
+    xbt_assert(xbt_dynar_is_empty(link_variables), "Should not have any declared link variable!");
     xbt_dynar_free(&link_variables);
   }