From 03c27179831733fff83ac0f341ce94b1be8be9ad Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 6 Mar 2014 12:56:54 +0100 Subject: [PATCH 1/1] Split xml files to avoid memory leaks in the parser. --- teshsuite/msg/CMakeLists.txt | 6 ++++-- teshsuite/msg/host_on_off.c | 4 ++-- teshsuite/msg/host_on_off.tesh | 2 +- teshsuite/msg/host_on_off_d.xml | 11 +++++++++++ teshsuite/msg/{host_on_off.xml => host_on_off_p.xml} | 10 +--------- teshsuite/msg/task_destroy_cancel.c | 4 ++-- teshsuite/msg/task_destroy_cancel.tesh | 2 +- teshsuite/msg/task_destroy_cancel_d.xml | 11 +++++++++++ ...k_destroy_cancel.xml => task_destroy_cancel_p.xml} | 10 +--------- 9 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 teshsuite/msg/host_on_off_d.xml rename teshsuite/msg/{host_on_off.xml => host_on_off_p.xml} (61%) create mode 100644 teshsuite/msg/task_destroy_cancel_d.xml rename teshsuite/msg/{task_destroy_cancel.xml => task_destroy_cancel_p.xml} (61%) diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 174c26213a..1656f25981 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -32,8 +32,10 @@ set(xml_files ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_p.xml ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/pid_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.xml - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.xml + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_p.xml + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_p.xml PARENT_SCOPE ) set(teshsuite_src diff --git a/teshsuite/msg/host_on_off.c b/teshsuite/msg/host_on_off.c index a26d7e07c9..8d01fc42ea 100644 --- a/teshsuite/msg/host_on_off.c +++ b/teshsuite/msg/host_on_off.c @@ -99,13 +99,13 @@ int main(int argc, char *argv[]) const char *application_file; MSG_init(&argc, argv); - if (argc < 2) { + 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); } platform_file = argv[1]; - application_file = argv[1]; + application_file = argv[2]; /* MSG_config("workstation/model","KCCFLN05"); */ { /* Simulation setting */ diff --git a/teshsuite/msg/host_on_off.tesh b/teshsuite/msg/host_on_off.tesh index 403d26d7de..7b613bcdcc 100644 --- a/teshsuite/msg/host_on_off.tesh +++ b/teshsuite/msg/host_on_off.tesh @@ -1,5 +1,5 @@ -$ msg/host_on_off ${srcdir:=.}/msg/host_on_off.xml +$ msg/host_on_off ${srcdir:=.}/msg/host_on_off_p.xml ${srcdir:=.}/msg/host_on_off_d.xml > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending "task on" > [Jupiter:slave:(2) 0.682345] [msg_test/INFO] Task "task on" done > [Tremblay:master:(1) 1.027003] [msg_test/INFO] Sending "task off" diff --git a/teshsuite/msg/host_on_off_d.xml b/teshsuite/msg/host_on_off_d.xml new file mode 100644 index 0000000000..5c8fc7fa6a --- /dev/null +++ b/teshsuite/msg/host_on_off_d.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/teshsuite/msg/host_on_off.xml b/teshsuite/msg/host_on_off_p.xml similarity index 61% rename from teshsuite/msg/host_on_off.xml rename to teshsuite/msg/host_on_off_p.xml index d57e0f384a..1947841342 100644 --- a/teshsuite/msg/host_on_off.xml +++ b/teshsuite/msg/host_on_off_p.xml @@ -10,12 +10,4 @@ - - - - - - - - - \ No newline at end of file + diff --git a/teshsuite/msg/task_destroy_cancel.c b/teshsuite/msg/task_destroy_cancel.c index 0d04024f04..6daa0d270d 100644 --- a/teshsuite/msg/task_destroy_cancel.c +++ b/teshsuite/msg/task_destroy_cancel.c @@ -125,13 +125,13 @@ int main(int argc, char *argv[]) const char *application_file; MSG_init(&argc, argv); - if (argc < 2) { + 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); } platform_file = argv[1]; - application_file = argv[1]; + application_file = argv[2]; /* MSG_config("workstation/model","KCCFLN05"); */ { /* Simulation setting */ diff --git a/teshsuite/msg/task_destroy_cancel.tesh b/teshsuite/msg/task_destroy_cancel.tesh index 1e3a6ba523..3569491b41 100644 --- a/teshsuite/msg/task_destroy_cancel.tesh +++ b/teshsuite/msg/task_destroy_cancel.tesh @@ -1,5 +1,5 @@ -$ msg/task_destroy_cancel ${srcdir:=.}/msg/task_destroy_cancel.xml +$ msg/task_destroy_cancel ${srcdir:=.}/msg/task_destroy_cancel_p.xml ${srcdir:=.}/msg/task_destroy_cancel_d.xml > [Tremblay:master:(1) 0.000000] [msg_test/INFO] Sending task: "normal" > [Jupiter:slave:(2) 0.027003] [msg_test/INFO] Handling task "normal" > [Tremblay:master:(1) 0.027003] [msg_test/INFO] Canceling task "cancel directly" directly diff --git a/teshsuite/msg/task_destroy_cancel_d.xml b/teshsuite/msg/task_destroy_cancel_d.xml new file mode 100644 index 0000000000..5c8fc7fa6a --- /dev/null +++ b/teshsuite/msg/task_destroy_cancel_d.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/teshsuite/msg/task_destroy_cancel.xml b/teshsuite/msg/task_destroy_cancel_p.xml similarity index 61% rename from teshsuite/msg/task_destroy_cancel.xml rename to teshsuite/msg/task_destroy_cancel_p.xml index d57e0f384a..1947841342 100644 --- a/teshsuite/msg/task_destroy_cancel.xml +++ b/teshsuite/msg/task_destroy_cancel_p.xml @@ -10,12 +10,4 @@ - - - - - - - - - \ No newline at end of file + -- 2.20.1