A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
coverage madness in examples
[simgrid.git]
/
examples
/
msg
/
masterslave
/
masterslave_arg.c
diff --git
a/examples/msg/masterslave/masterslave_arg.c
b/examples/msg/masterslave/masterslave_arg.c
index
fd97d2a
..
69634cf
100644
(file)
--- a/
examples/msg/masterslave/masterslave_arg.c
+++ b/
examples/msg/masterslave/masterslave_arg.c
@@
-1,11
+1,11
@@
-/* Copyright (c) 2010-201
2
. The SimGrid Team.
+/* Copyright (c) 2010-201
5
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <stdio.h>
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include <stdio.h>
-#include "
msg/msg.h" /* Yeah! If you want to use msg, you need to include msg
/msg.h */
+#include "
simgrid/msg.h" /* Yeah! If you want to use msg, you need to include simgrid
/msg.h */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
#include "xbt/sysdep.h" /* calloc, printf */
/* Create a log channel to have nice outputs. */
@@
-67,7
+67,7
@@
int master(int argc, char *argv[])
int slave(int argc, char *argv[])
{
msg_task_t task = NULL;
int slave(int argc, char *argv[])
{
msg_task_t task = NULL;
-
_XBT_GNUC
_UNUSED int res;
+
XBT_ATTRIB
_UNUSED int res;
XBT_DEBUG("mailbox: %s",MSG_process_get_name(MSG_process_self()));
while (1) {
XBT_DEBUG("mailbox: %s",MSG_process_get_name(MSG_process_self()));
while (1) {
@@
-85,7
+85,9
@@
int slave(int argc, char *argv[])
MSG_task_destroy(task);
task = NULL;
}
MSG_task_destroy(task);
task = NULL;
}
- XBT_DEBUG("I'm done. See you!");
+ xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);XBT_DEBUG("I'm done. See you!");
return 0;
} /* end_of_slave */ /* end_of_test_all */
return 0;
} /* end_of_slave */ /* end_of_test_all */
@@
-96,11
+98,9
@@
int main(int argc, char *argv[])
long i;
MSG_init(&argc, argv);
long i;
MSG_init(&argc, argv);
- if (argc < 4) {
- printf("Usage: %s platform_file number_of_jobs number_of_slaves\n", argv[0]);
- printf("example: %s msg_platform.xml 10 5\n", argv[0]);
- exit(1);
- }
+ xbt_assert(argc > 3, "Usage: %s platform_file number_of_jobs number_of_slaves\n"
+ "\tExample: %s msg_platform.xml 10 5\n",
+ argv[0], argv[0]);
MSG_function_register("master", master);
MSG_function_register("slave", slave);
MSG_function_register("master", master);
MSG_function_register("slave", slave);
@@
-138,8
+138,5
@@
int main(int argc, char *argv[])
XBT_INFO("Simulation time %g", MSG_get_clock());
XBT_INFO("Simulation time %g", MSG_get_clock());
- if (res == MSG_OK)
- return 0;
- else
- return 1;
-} /* end_of_main */
+ return res != MSG_OK;
+}