From 62346ee41a140137645972d4cb363c1e1a6a4b43 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Tue, 11 Mar 2014 10:24:54 +0100 Subject: [PATCH] Split another xml file (memory leaks in the parser). --- teshsuite/msg/CMakeLists.txt | 15 ++++++++------- teshsuite/msg/process.c | 4 ++-- teshsuite/msg/process.tesh | 2 +- teshsuite/msg/{process.xml => process_d.xml} | 9 ++------- teshsuite/msg/process_p.xml | 8 ++++++++ 5 files changed, 21 insertions(+), 17 deletions(-) rename teshsuite/msg/{process.xml => process_d.xml} (75%) create mode 100644 teshsuite/msg/process_p.xml diff --git a/teshsuite/msg/CMakeLists.txt b/teshsuite/msg/CMakeLists.txt index 983748ba10..670d9dcf5c 100644 --- a/teshsuite/msg/CMakeLists.txt +++ b/teshsuite/msg/CMakeLists.txt @@ -23,32 +23,33 @@ endif() set(tesh_files ${tesh_files} ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.tesh - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/pid.tesh ${CMAKE_CURRENT_SOURCE_DIR}/process.tesh + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.tesh PARENT_SCOPE ) set(xml_files ${xml_files} ${CMAKE_CURRENT_SOURCE_DIR}/get_sender_d.xml ${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_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off_p.xml + ${CMAKE_CURRENT_SOURCE_DIR}/pid_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/pid_p.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process_d.xml + ${CMAKE_CURRENT_SOURCE_DIR}/process_p.xml ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_d.xml ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel_p.xml - ${CMAKE_CURRENT_SOURCE_DIR}/process.xml PARENT_SCOPE ) set(teshsuite_src ${teshsuite_src} ${CMAKE_CURRENT_SOURCE_DIR}/get_sender.c - ${CMAKE_CURRENT_SOURCE_DIR}/pid.c ${CMAKE_CURRENT_SOURCE_DIR}/host_on_off.c - ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c + ${CMAKE_CURRENT_SOURCE_DIR}/pid.c ${CMAKE_CURRENT_SOURCE_DIR}/process.c + ${CMAKE_CURRENT_SOURCE_DIR}/task_destroy_cancel.c PARENT_SCOPE ) set(bin_files diff --git a/teshsuite/msg/process.c b/teshsuite/msg/process.c index 7691a5237f..e999b4bed0 100644 --- a/teshsuite/msg/process.c +++ b/teshsuite/msg/process.c @@ -78,13 +78,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/process.tesh b/teshsuite/msg/process.tesh index e4a0fdb6dd..728b65c56f 100644 --- a/teshsuite/msg/process.tesh +++ b/teshsuite/msg/process.tesh @@ -1,5 +1,5 @@ -$ msg/process ${srcdir:=.}/msg/process.xml +$ msg/process ${srcdir:=.}/msg/process_p.xml ${srcdir:=.}/msg/process_d.xml > [Tremblay:slave:(2) 0.500000] [msg_test/INFO] Slave started (PID:2, PPID:0) > [Tremblay:slave:(2) 0.500000] [msg_test/INFO] Plop i am not suspended > [Tremblay:master:(1) 1.000000] [msg_test/INFO] Process(pid=1, ppid=0, name=master) diff --git a/teshsuite/msg/process.xml b/teshsuite/msg/process_d.xml similarity index 75% rename from teshsuite/msg/process.xml rename to teshsuite/msg/process_d.xml index f0c3dae669..ee058c5ecf 100644 --- a/teshsuite/msg/process.xml +++ b/teshsuite/msg/process_d.xml @@ -1,16 +1,11 @@ - - - - - - + - \ No newline at end of file + \ No newline at end of file diff --git a/teshsuite/msg/process_p.xml b/teshsuite/msg/process_p.xml new file mode 100644 index 0000000000..90e976acee --- /dev/null +++ b/teshsuite/msg/process_p.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file -- 2.20.1