From: Marion Guthmuller Date: Mon, 30 Jul 2012 14:17:15 +0000 (+0200) Subject: model-checker : update tests for snapshot comparison X-Git-Tag: v3_8~250^2~5 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b79da01a63a9ec59158c97c2fb9b0108a91be00d?ds=sidebyside model-checker : update tests for snapshot comparison --- diff --git a/src/mc/test/compare_snapshot.c b/src/mc/test/compare_snapshot.c index 59d2e6470a..b97a629832 100644 --- a/src/mc/test/compare_snapshot.c +++ b/src/mc/test/compare_snapshot.c @@ -21,11 +21,11 @@ static void test1() mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); MC_take_snapshot_liveness(snapshot2); - MC_UNSET_RAW_MEM; - int res = snapshot_compare(snapshot1, snapshot2); xbt_assert(res == 0); + MC_UNSET_RAW_MEM; + fprintf(stderr, "\n**************** END TEST 1 ****************\n"); MC_SET_RAW_MEM; @@ -49,7 +49,7 @@ static void test2() MC_UNSET_RAW_MEM; - char* t = strdup("toto"); + char* t = malloc(5); MC_SET_RAW_MEM; @@ -87,7 +87,7 @@ static void test3() MC_UNSET_RAW_MEM; - char *t = strdup("toto");; + char *t = malloc(5); free(t); MC_SET_RAW_MEM; @@ -116,7 +116,7 @@ static void test4() fprintf(stderr, "\n**************** TEST 4 ****************\n\n"); - char *t = strdup("toto"); + char *t = malloc(5); MC_SET_RAW_MEM; @@ -238,6 +238,9 @@ void MC_test_snapshot_comparison(){ MC_UNSET_RAW_MEM; test1(); + + MC_restore_snapshot(initial); + MC_UNSET_RAW_MEM; test2(); @@ -260,4 +263,7 @@ void MC_test_snapshot_comparison(){ MC_UNSET_RAW_MEM; test6(); + + MC_restore_snapshot(initial); + MC_UNSET_RAW_MEM; }