Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move OSSP testsuite code out of the testsuite/ dir so that it becomes part of XBT
[simgrid.git] / testsuite / xbt / ex_test.c
index 95dd6f8..5bb4c92 100644 (file)
@@ -33,8 +33,9 @@
 #include <time.h>
 #include <string.h>
 
 #include <time.h>
 #include <string.h>
 
-#include "ex_test_ts.h"
+#include "xbt/testsuite.h"
 #include "xbt/ex.h"
 #include "xbt/ex.h"
+#include "xbt/log.h"
 
 XBT_LOG_NEW_CATEGORY(test,"This test");
 
 
 XBT_LOG_NEW_CATEGORY(test,"This test");
 
@@ -66,6 +67,7 @@ TS_TEST(test_controlflow)
         if (n != 4)
             ts_test_fail(TS_CTX, "M4: n=%d (!= 4)", n);
         n++;
         if (n != 4)
             ts_test_fail(TS_CTX, "M4: n=%d (!= 4)", n);
         n++;
+        xbt_ex_free(ex);
     }
     if (n != 5)
         ts_test_fail(TS_CTX, "M5: n=%d (!= 5)", n);
     }
     if (n != 5)
         ts_test_fail(TS_CTX, "M5: n=%d (!= 5)", n);
@@ -85,6 +87,7 @@ TS_TEST(test_value)
             ts_test_fail(TS_CTX, "value=%d (!= 2)", ex.value);
         if (strcmp(ex.msg,"toto"))
             ts_test_fail(TS_CTX, "message=%s (!= toto)", ex.msg);
             ts_test_fail(TS_CTX, "value=%d (!= 2)", ex.value);
         if (strcmp(ex.msg,"toto"))
             ts_test_fail(TS_CTX, "message=%s (!= toto)", ex.msg);
+        xbt_ex_free(ex);
     }
 }
 
     }
 }
 
@@ -108,6 +111,7 @@ TS_TEST(test_variables)
         /* r2 is allowed to be destroyed because not volatile */
         if (v2 != 5678)
             ts_test_fail(TS_CTX, "v2=%d (!= 5678)", v2);
         /* r2 is allowed to be destroyed because not volatile */
         if (v2 != 5678)
             ts_test_fail(TS_CTX, "v2=%d (!= 5678)", v2);
+        xbt_ex_free(ex);
     }
 }
 
     }
 }
 
@@ -133,6 +137,7 @@ TS_TEST(test_cleanup)
             ts_test_fail(TS_CTX, "v1 = %d (!= 5678)", v1);
         if (!(ex.category == 1 && ex.value == 2 && !strcmp(ex.msg,"blah")))
             ts_test_fail(TS_CTX, "unexpected exception contents");
             ts_test_fail(TS_CTX, "v1 = %d (!= 5678)", v1);
         if (!(ex.category == 1 && ex.value == 2 && !strcmp(ex.msg,"blah")))
             ts_test_fail(TS_CTX, "unexpected exception contents");
+        xbt_ex_free(ex);
     }
     if (!c)
         ts_test_fail(TS_CTX, "ex_cleanup not executed");
     }
     if (!c)
         ts_test_fail(TS_CTX, "ex_cleanup not executed");