X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2568ec7bdc945fa4beebf200756910f8b5b7903a..bc886906b9a15893564fa127a8933f0a50e40de6:/teshsuite/mc/mutex_handling.c diff --git a/teshsuite/mc/mutex_handling.c b/teshsuite/mc/mutex_handling.c index 4db2783552..e13bd2fdc2 100644 --- a/teshsuite/mc/mutex_handling.c +++ b/teshsuite/mc/mutex_handling.c @@ -19,14 +19,11 @@ * and the MC does not find the counter-example. */ -#include #include "simgrid/msg.h" -#include "xbt/log.h" #include "mc/mc.h" #include -XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, - "Messages specific for this msg example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test, "Messages specific for this msg example"); #define BOX_NAME "box" @@ -65,18 +62,14 @@ static int sender(int argc, char *argv[]) int main(int argc, char *argv[]) { MSG_init(&argc, argv); - 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); - } - const char *platform_file = argv[1]; - const char *application_file = argv[2]; - MSG_create_environment(platform_file); + xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n" + "\tExample: %s msg_platform.xml msg_deployment.xml\n", argv[0], argv[0]); + + MSG_create_environment(argv[1]); MSG_function_register("receiver", receiver); MSG_function_register("sender", sender); - MSG_launch_application(application_file); + MSG_launch_application(argv[2]); #ifndef DISABLE_THE_MUTEX mutex = xbt_mutex_init(); #endif @@ -86,8 +79,5 @@ int main(int argc, char *argv[]) #endif XBT_INFO("Simulation time %g", MSG_get_clock()); - if (res == MSG_OK) - return 0; - else - return 1; -} \ No newline at end of file + return res != MSG_OK; +}