Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix SimDag exception test
authorthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jul 2006 13:23:34 +0000 (13:23 +0000)
committerthiery <thiery@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 18 Jul 2006 13:23:34 +0000 (13:23 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2615 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/simdag/mixtesim/src/main.c
examples/simdag/sd_test.c

index 32bafdc..b44e5e9 100644 (file)
@@ -28,7 +28,7 @@ int main(int argc, char **argv) {
 
 /*   xbt_log_control_set("sd.thres=debug"); */
 /*   xbt_log_control_set("sd_kernel.thres=debug"); */
 
 /*   xbt_log_control_set("sd.thres=debug"); */
 /*   xbt_log_control_set("sd_kernel.thres=debug"); */
-/*   xbt_log_control_set("surf_kernel.thres=debug"); */
+/*   xbt_log_control_set("surf.thres=debug"); */
 /*   xbt_log_control_set("mixtesim.thres=debug"); */
 
   
 /*   xbt_log_control_set("mixtesim.thres=debug"); */
 
   
index 55a57c0..9910ac4 100644 (file)
@@ -13,6 +13,8 @@ int main(int argc, char **argv) {
   /* initialisation of SD */
   SD_init(&argc, 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]);
   if (argc < 2) {
     INFO1("Usage: %s platform_file", argv[0]);
     INFO1("example: %s sd_platform.xml", argv[0]);
@@ -70,35 +72,41 @@ int main(int argc, char **argv) {
 
   TRY {
     SD_task_dependency_add(NULL, NULL, taskA, taskA); /* shouldn't work and must raise an exception */
 
   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) {
   }
   CATCH (ex) {
+    if (ex.category != arg_error)
+      RETHROW; /* this is a serious error */
     xbt_ex_free(ex);
   }
   
   TRY {
     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) {
   }
   CATCH (ex) {
+    if (ex.category != arg_error)
+      RETHROW;
     xbt_ex_free(ex);
   }
 
     xbt_ex_free(ex);
   }
 
-  SD_task_dependency_remove(taskA, taskB);
-
   TRY {
   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) {
   }
   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_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) {
   }
   CATCH (ex) {
+    if (ex.category != arg_error)
+      RETHROW;
     xbt_ex_free(ex);
   }
 
     xbt_ex_free(ex);
   }