From fcf60a686ecafe108ddfa713e108ec55c3bd8263 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 1 Nov 2015 12:26:07 +0100 Subject: [PATCH] fix a test that got broken when I suppressed some simcalls The execution order changed a very little bit as host_get_speed is not a simcall anymore, and the process got the opportunity to start a new task (and do the corresponding output) before being killed at the same timestamp. But it actually dies at that timestamp, everything alright. --- teshsuite/msg/host_on_off_processes/host_on_off_processes.c | 5 +++-- .../msg/host_on_off_processes/host_on_off_processes.tesh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c index b0ab9426bf..0b19a419b4 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.c +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.c @@ -21,6 +21,7 @@ int commRX(int argc, char *argv[]); int commTX(int argc, char *argv[]); xbt_dynar_t tests; +int tasks_done = 0; int test_launcher(int argc, char *argv[]) { @@ -42,7 +43,7 @@ int test_launcher(int argc, char *argv[]) XBT_INFO(" Turn off Jupiter"); MSG_host_off(jupiter); MSG_process_sleep(10); - XBT_INFO("Test 1 seems ok, cool !(number of Process : %d, it should be 1 (i.e. the Test one))", MSG_process_get_number()); + XBT_INFO("Test 1 seems ok, cool !(#Processes: %d, it should be 1; #tasks: %d)", MSG_process_get_number(), tasks_done); } test = 2; @@ -172,7 +173,6 @@ int test_launcher(int argc, char *argv[]) return 0; } -// adsein: Is this really a daemon ? it ran only one task ? I just added a stupid loop int process_daemon(int argc, char *argv[]) { msg_task_t task = NULL; @@ -182,6 +182,7 @@ int process_daemon(int argc, char *argv[]) XBT_INFO(" Execute daemon"); MSG_task_execute(task); MSG_task_destroy(task); + tasks_done ++; } XBT_INFO(" daemon done. See you!"); return 0; diff --git a/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh b/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh index 0e7369d1ef..090157acf6 100644 --- a/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh +++ b/teshsuite/msg/host_on_off_processes/host_on_off_processes.tesh @@ -7,7 +7,8 @@ $ ./host_on_off_processes ${srcdir:=.}/../../../examples/platforms/small_platfor > [Jupiter:process_daemon:(2) 1.000000] [msg_test/INFO] Execute daemon > [Jupiter:process_daemon:(2) 2.000000] [msg_test/INFO] Execute daemon > [Tremblay:test_launcher:(1) 3.000000] [msg_test/INFO] Turn off Jupiter -> [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO] Test 1 seems ok, cool !(number of Process : 1, it should be 1 (i.e. the Test one)) +> [Jupiter:process_daemon:(2) 3.000000] [msg_test/INFO] Execute daemon +> [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO] Test 1 seems ok, cool !(#Processes: 1, it should be 1; #tasks: 3) > [Tremblay:test_launcher:(1) 13.000000] [msg_test/INFO] Test done. See you! > [13.000000] [msg_test/INFO] Simulation time 13 -- 2.20.1