X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a9950e96250eb4d483964721e1d83aa9c63960e9..05a81a473f36ee2298730ccc85d4033affad4018:/teshsuite/msg/listen_async/listen_async.c diff --git a/teshsuite/msg/listen_async/listen_async.c b/teshsuite/msg/listen_async/listen_async.c index d32852bf96..3e409d6a42 100644 --- a/teshsuite/msg/listen_async/listen_async.c +++ b/teshsuite/msg/listen_async/listen_async.c @@ -4,7 +4,6 @@ * This occures in Java and C, but is only tested here in C. */ -#include #include "simgrid/msg.h" XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); @@ -13,7 +12,7 @@ static int server(int argc, char *argv[]) { msg_task_t task = MSG_task_create("a", 0, 0, (char*)"Some data"); MSG_task_isend(task, "mailbox"); - + xbt_assert(MSG_task_listen("mailbox")); // True (1) XBT_INFO("Task listen works on regular mailboxes"); task = NULL; @@ -21,11 +20,11 @@ static int server(int argc, char *argv[]) xbt_assert(!strcmp("Some data", MSG_task_get_data(task)), "Data received: %s", (char*)MSG_task_get_data(task)); MSG_task_destroy(task); XBT_INFO("Data successfully received from regular mailbox"); - + MSG_mailbox_set_async("mailbox2"); task = MSG_task_create("b", 0, 0, (char*)"More data"); MSG_task_isend(task, "mailbox2"); - + xbt_assert(MSG_task_listen("mailbox2")); // used to break. XBT_INFO("Task listen works on asynchronous mailboxes"); task = NULL; @@ -33,11 +32,10 @@ static int server(int argc, char *argv[]) xbt_assert(!strcmp("More data", MSG_task_get_data(task))); MSG_task_destroy(task); XBT_INFO("Data successfully received from asynchronous mailbox"); - + return 0; } - int main(int argc, char *argv[]) { MSG_init(&argc, argv); @@ -45,6 +43,6 @@ int main(int argc, char *argv[]) MSG_create_environment(argv[1]); MSG_process_create("test", server, NULL, MSG_host_by_name("Tremblay")); MSG_main(); - + return 0; }