Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
these are not c++ tests
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 8 Mar 2020 12:42:11 +0000 (13:42 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 8 Mar 2020 12:47:45 +0000 (13:47 +0100)
MANIFEST.in
teshsuite/msg/CMakeLists.txt
teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c [moved from teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp with 84% similarity]
teshsuite/msg/task_listen_from/task_listen_from.c [moved from teshsuite/msg/task_listen_from/task_listen_from.cpp with 88% similarity]

index 172a5ec..cd749ce 100644 (file)
@@ -678,9 +678,9 @@ include teshsuite/msg/io-file/io-file.tesh
 include teshsuite/msg/platform-properties/platform-properties.c
 include teshsuite/msg/platform-properties/platform-properties.tesh
 include teshsuite/msg/platform-properties/platform-properties_d.xml
-include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.cpp
+include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.c
 include teshsuite/msg/task_destroy_cancel/task_destroy_cancel.tesh
-include teshsuite/msg/task_listen_from/task_listen_from.cpp
+include teshsuite/msg/task_listen_from/task_listen_from.c
 include teshsuite/msg/task_listen_from/task_listen_from.tesh
 include teshsuite/msg/task_progress/task_progress.cpp
 include teshsuite/msg/task_progress/task_progress.tesh
@@ -727,20 +727,20 @@ include teshsuite/s4u/pid/pid.cpp
 include teshsuite/s4u/pid/pid.tesh
 include teshsuite/s4u/storage_client_server/storage_client_server.cpp
 include teshsuite/s4u/storage_client_server/storage_client_server.tesh
+include teshsuite/s4u/trace-integration/test-hbp1-c0s0-c0s1.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c0s0-c1s0.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c0s1-c0s2.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c0s1-c2s2.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c0s2-c1s0.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c0s2-c1s1.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c1s1-c1s2.xml
+include teshsuite/s4u/trace-integration/test-hbp1-c1s1-c3s2.xml
+include teshsuite/s4u/trace-integration/test-hbp1.0-hbp1.0-hbp1.0.xml
+include teshsuite/s4u/trace-integration/test-hbp1.0-hbp3.0-hbp4.0.xml
+include teshsuite/s4u/trace-integration/test-hbp1.5-hbp1.5.xml
+include teshsuite/s4u/trace-integration/test-hbp2.5-hbp1.5.xml
 include teshsuite/s4u/trace-integration/trace-integration.cpp
 include teshsuite/s4u/trace-integration/trace-integration.tesh
-include teshsuite/s4u/trace_integration/test-hbp1-c0s0-c0s1.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c0s0-c1s0.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c0s1-c0s2.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c0s1-c2s2.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c0s2-c1s0.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c0s2-c1s1.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c1s1-c1s2.xml
-include teshsuite/s4u/trace_integration/test-hbp1-c1s1-c3s2.xml
-include teshsuite/s4u/trace_integration/test-hbp1.0-hbp1.0-hbp1.0.xml
-include teshsuite/s4u/trace_integration/test-hbp1.0-hbp3.0-hbp4.0.xml
-include teshsuite/s4u/trace_integration/test-hbp1.5-hbp1.5.xml
-include teshsuite/s4u/trace_integration/test-hbp2.5-hbp1.5.xml
 include teshsuite/s4u/wait-any-for/wait-any-for.cpp
 include teshsuite/s4u/wait-any-for/wait-any-for.tesh
 include teshsuite/simdag/availability/availability.c
index 437c1fd..93d1d57 100644 (file)
@@ -1,8 +1,5 @@
 # C examples
-foreach(x cloud-two-tasks
-          get_sender
-          platform-properties
-          io-file)
+foreach(x cloud-two-tasks get_sender platform-properties io-file task_listen_from task_destroy_cancel)
   if(enable_msg)
     add_executable       (${x} EXCLUDE_FROM_ALL ${x}/${x}.c)
     target_link_libraries(${x} simgrid)
@@ -15,7 +12,7 @@ foreach(x cloud-two-tasks
 endforeach()
 
 # CPP examples
-foreach(x task_destroy_cancel task_listen_from task_progress host_on_off_processes)
+foreach(x task_progress host_on_off_processes)
   if(enable_msg)
     add_executable       (${x}  EXCLUDE_FROM_ALL ${x}/${x}.cpp)
     target_link_libraries(${x}  simgrid)
@@ -3,16 +3,15 @@
 /* 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. */
 
-#include "simgrid/Exception.hpp"
 #include "simgrid/msg.h"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int master(int /*argc*/, char* /*argv*/ [])
+static int master(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   double task_comp_size = 5E7;
   double task_comm_size = 1E6;
-  double timeout = 1;
+  double timeout        = 1;
 
   msg_task_t task = MSG_task_create("normal", task_comp_size, task_comm_size, NULL);
   XBT_INFO("Sending task: \"%s\"", MSG_task_get_name(task));
@@ -27,7 +26,7 @@ static int master(int /*argc*/, char* /*argv*/ [])
   XBT_INFO("Destroying task \"%s\" directly", MSG_task_get_name(task));
   MSG_task_destroy(task);
 
-  task = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
+  task            = MSG_task_create("cancel", task_comp_size, task_comm_size, NULL);
   msg_comm_t comm = MSG_task_isend(task, "worker_mailbox");
   XBT_INFO("Canceling task \"%s\" during comm", MSG_task_get_name(task));
   MSG_task_cancel(task);
@@ -52,9 +51,9 @@ static int master(int /*argc*/, char* /*argv*/ [])
   return 0;
 }
 
-static int worker_main(int /*argc*/, char* /*argv*/ [])
+static int worker_main(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
-  msg_task_t task = (msg_task_t) MSG_process_get_data(MSG_process_self());
+  msg_task_t task = (msg_task_t)MSG_process_get_data(MSG_process_self());
   msg_error_t res;
   XBT_INFO("Start %s", MSG_task_get_name(task));
   res = MSG_task_execute(task);
@@ -63,21 +62,21 @@ static int worker_main(int /*argc*/, char* /*argv*/ [])
   return 0;
 }
 
-static int worker(int /*argc*/, char* /*argv*/ [])
+static int worker(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
   while (1) {
-    msg_task_t task = NULL;
+    msg_task_t task           = NULL;
     XBT_ATTRIB_UNUSED int res = MSG_task_receive(&(task), "worker_mailbox");
     xbt_assert(res == MSG_OK, "MSG_task_get failed");
     XBT_INFO("Handling task \"%s\"", MSG_task_get_name(task));
 
-    if (not strcmp(MSG_task_get_name(task), "finalize")) {
+    if (!strcmp(MSG_task_get_name(task), "finalize")) {
       XBT_INFO("Destroying task \"%s\"", MSG_task_get_name(task));
       MSG_task_destroy(task);
       break;
     }
 
-    if (not strcmp(MSG_task_get_name(task), "cancel")) {
+    if (!strcmp(MSG_task_get_name(task), "cancel")) {
       MSG_process_create("worker1", worker_main, task, MSG_host_self());
       MSG_process_sleep(0.1);
       XBT_INFO("Canceling task \"%s\"", MSG_task_get_name(task));
@@ -97,7 +96,7 @@ static int worker(int /*argc*/, char* /*argv*/ [])
   return 0;
 }
 
-int main(int argc, char *argv[])
+int main(int argc, charargv[])
 {
   MSG_init(&argc, argv);
   xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
@@ -9,9 +9,9 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example");
 
-static int tester(int, char**)
+static int tester(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
 {
-  msg_task_t task = MSG_task_create("name", 0, 10, NULL);
+  msg_task_t task       = MSG_task_create("name", 0, 10, NULL);
   const_msg_comm_t comm = MSG_task_isend(task, "mailbox");
 
   XBT_INFO("MSG_task_listen_from returns() %d (should return my pid, which is %d)", MSG_task_listen_from("mailbox"),