Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
improve coverage in teshsuite
[simgrid.git] / teshsuite / msg / host_on_off / host_on_off_wait.c
index 0733dcd..a3d829e 100644 (file)
@@ -25,10 +25,7 @@ int master(int argc, char *argv[])
   TRY {
     msg_host_t jupiter = MSG_host_by_name("Jupiter");
     XBT_INFO("Master waiting");
-    if(MSG_process_sleep(1)) {
-      XBT_ERROR("Unexpected error while sleeping");
-      return 1;
-    }
+    MSG_process_sleep(1);
 
     XBT_INFO("Turning off the slave host");
     MSG_host_off(jupiter);
@@ -67,11 +64,9 @@ int main(int argc, char *argv[])
   const char *application_file;
 
   MSG_init(&argc, argv);
-  if (argc != 3) {
-    printf("Usage: %s platform_file deployment_file\n", argv[0]);
-    printf("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
-    exit(1);
-  }
+  xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+            "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]);
+
   platform_file = argv[1];
   application_file = argv[2];
 
@@ -88,8 +83,5 @@ int main(int argc, char *argv[])
 
   XBT_INFO("Simulation time %g", MSG_get_clock());
 
-  if (res == MSG_OK)
-    return 0;
-  else
-    return 1;
+  return res != MSG_OK;
 }                               /* end_of_main */