From 0621557a3bed9466230014dd0e70d2d7186c9bd4 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 21 Jan 2016 10:45:20 +0100 Subject: [PATCH] cosmetics in teshsuite/msg/host_on_off -- don't ask why --- teshsuite/msg/host_on_off/host_on_off_recv.c | 23 +++++++++----------- teshsuite/msg/host_on_off/host_on_off_wait.c | 5 +---- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/teshsuite/msg/host_on_off/host_on_off_recv.c b/teshsuite/msg/host_on_off/host_on_off_recv.c index bd6a7bd082..3763cac66e 100644 --- a/teshsuite/msg/host_on_off/host_on_off_recv.c +++ b/teshsuite/msg/host_on_off/host_on_off_recv.c @@ -31,15 +31,13 @@ int master(int argc, char *argv[]) MSG_process_sleep(0.5); msg_comm_t comm = NULL; - if (1) { + { msg_task_t task = MSG_task_create("COMM", 0, 100000000, NULL); comm = MSG_task_isend(task, mailbox); } - if(MSG_process_sleep(0.5)) { - XBT_ERROR("Unexpected error while sleeping"); - return 1; - } + MSG_process_sleep(0.5); + XBT_INFO("Turning off the slave host"); MSG_host_off(jupiter); @@ -95,15 +93,14 @@ int main(int argc, char *argv[]) platform_file = argv[1]; application_file = argv[2]; - { /* Simulation setting */ - MSG_create_environment(platform_file); - } - { /* Application deployment */ - MSG_function_register("master", master); - MSG_function_register("slave", slave); + /* Simulation setting */ + MSG_create_environment(platform_file); + + /* Application deployment */ + MSG_function_register("master", master); + MSG_function_register("slave", slave); + MSG_launch_application(application_file); - MSG_launch_application(application_file); - } res = MSG_main(); XBT_INFO("Simulation time %g", MSG_get_clock()); diff --git a/teshsuite/msg/host_on_off/host_on_off_wait.c b/teshsuite/msg/host_on_off/host_on_off_wait.c index 0733dcdcf4..5c35cb9408 100644 --- a/teshsuite/msg/host_on_off/host_on_off_wait.c +++ b/teshsuite/msg/host_on_off/host_on_off_wait.c @@ -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); -- 2.20.1