X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/290ae378d376167e6090af14de0835ec2efa55a3..539d5cccbc6baf033b0bc4b24c31d2875a79abf4:/examples/simdag/sd_test.c diff --git a/examples/simdag/sd_test.c b/examples/simdag/sd_test.c index 0fee072b6d..9910ac412a 100644 --- a/examples/simdag/sd_test.c +++ b/examples/simdag/sd_test.c @@ -13,6 +13,8 @@ int main(int argc, char **argv) { /* initialisation of SD */ SD_init(&argc, argv); + xbt_log_control_set("sd.thres=debug"); + if (argc < 2) { INFO1("Usage: %s platform_file", argv[0]); INFO1("example: %s sd_platform.xml", argv[0]); @@ -70,32 +72,42 @@ int main(int argc, char **argv) { TRY { SD_task_dependency_add(NULL, NULL, taskA, taskA); /* shouldn't work and must raise an exception */ - xbt_assert0(0, "Hey, I can add a dependency between Task A and Task A!"); + xbt_die("Hey, I can add a dependency between Task A and Task A!"); } CATCH (ex) { + if (ex.category != arg_error) + RETHROW; /* this is a serious error */ + xbt_ex_free(ex); } TRY { - SD_task_dependency_add(NULL, NULL, taskA, taskB); /* shouldn't work and must raise an exception */ - xbt_assert0(0, "Oh oh, I can add an already existing dependency!"); + SD_task_dependency_add(NULL, NULL, taskB, taskA); /* shouldn't work and must raise an exception */ + xbt_die("Oh oh, I can add an already existing dependency!"); } CATCH (ex) { + if (ex.category != arg_error) + RETHROW; + xbt_ex_free(ex); } - SD_task_dependency_remove(taskA, taskB); - TRY { - SD_task_dependency_remove(taskC, taskA); /* shouldn't work and must raise an exception */ - xbt_assert0(0, "Dude, I can remove an unknown dependency!"); + SD_task_dependency_remove(taskA, taskC); /* shouldn't work and must raise an exception */ + xbt_die("Dude, I can remove an unknown dependency!"); } CATCH (ex) { + if (ex.category != arg_error) + RETHROW; + xbt_ex_free(ex); } TRY { SD_task_dependency_remove(taskC, taskC); /* shouldn't work and must raise an exception */ - xbt_assert0(0, "Wow, I can remove a dependency between Task C and itself!"); + xbt_die("Wow, I can remove a dependency between Task C and itself!"); } CATCH (ex) { + if (ex.category != arg_error) + RETHROW; + xbt_ex_free(ex); }