int id = -1;
char mailbox[80];
msg_comm_t res_irecv;
- xbt_assert1(sscanf(argv[1], "%d", &id),
- "Invalid argument %s\n", argv[1]);
+ int read = sscanf(argv[1], "%d", &id)
+ xbt_assert1(read, "Invalid argument %s\n", argv[1]);
MSG_process_sleep(10);
sprintf(mailbox, "receiver-%d", id);
while (1) {
sprintf(mailbox, "finalize");
msg_comm_t res_irecv;
+ MSG_error_t res_wait;
for (i = 0; i < receivers_count; i++) {
task = NULL;
res_irecv = MSG_task_irecv(&(task), mailbox);
- xbt_assert0(MSG_comm_wait(res_irecv, -1) == MSG_OK,
- "MSG_comm_wait failed");
+ res_wait = MSG_comm_wait(res_irecv, -1);
+ xbt_assert0(res == MSG_OK, "MSG_comm_wait failed");
MSG_comm_destroy(res_irecv);
MSG_task_destroy(task);
}
int tasks = atof(argv[2]);
m_task_t *task = xbt_new(m_task_t, tasks);
- xbt_assert1(sscanf(argv[1], "%d", &id),
- "Invalid argument %s\n", argv[1]);
+ int read = sscanf(argv[1], "%d", &id);
+ xbt_assert1(read, "Invalid argument %s\n", argv[1]);
sprintf(mailbox, "receiver-%d", id);
MSG_process_sleep(10);
msg_comm_t res_irecv;
int i;
- xbt_assert1(sscanf(argv[1], "%d", &number_of_tasks),
- "Invalid argument %s\n", argv[1]);
- xbt_assert1(sscanf(argv[2], "%lg", &task_comp_size),
- "Invalid argument %s\n", argv[2]);
- xbt_assert1(sscanf(argv[3], "%lg", &task_comm_size),
- "Invalid argument %s\n", argv[3]);
+ int res = sscanf(argv[1], "%d", &number_of_tasks);
+ xbt_assert1("Invalid argument %s\n", argv[1]);
+ res = sscanf(argv[2], "%lg", &task_comp_size);
+ xbt_assert1(res, "Invalid argument %s\n", argv[2]);
+ res = sscanf(argv[3], "%lg", &task_comm_size);
+ xbt_assert1(res, "Invalid argument %s\n", argv[3]);
{ /* Task creation */
char sprintf_buffer[64];
double priority = 1.0;
m_task_t task = NULL;
-
- xbt_assert1(sscanf(argv[1], "%lg", &computation_amount),
- "Invalid argument %s\n", argv[1]);
- xbt_assert1(sscanf(argv[2], "%lg", &priority),
- "Invalid argument %s\n", argv[2]);
+ int res = sscanf(argv[1], "%lg", &computation_amount);
+ xbt_assert1(res, "Invalid argument %s\n", argv[1]);
+ res = sscanf(argv[2], "%lg", &priority);
+ xbt_assert1(res, "Invalid argument %s\n", argv[2]);
INFO2("Hello! Running a task of size %g with priority %g",
computation_amount, priority);
* @addtogroup XBT_error
* @brief Those are the SimGrid version of the good ol' assert macro.
*
- * You can pass them a format message and arguments, just as if it where a printf.
+ * You can pass them a format message and arguments, just as if it where a
+ * printf.
* It is converted to a CRITICALn logging request.
+ * Be careful: the boolean expression that you want to test should not have
+ * side effects, because assertions are disabled at compile time if NDEBUG
+ * is set.
*
* @{
*/