X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4334de1a3cf1c1b19c78fe059b6481a1e53b96c8..bf667234dc6219eb5ee398d5dca36a3a16ec340f:/src/mc/test/compare_snapshot.c diff --git a/src/mc/test/compare_snapshot.c b/src/mc/test/compare_snapshot.c index 59d2e6470a..d8ad53be3a 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,8 +49,9 @@ static void test2() MC_UNSET_RAW_MEM; - char* t = strdup("toto"); - + char* t = malloc(50); + t = strdup("toto"); + MC_SET_RAW_MEM; /* Save second snapshot */ @@ -87,7 +88,8 @@ static void test3() MC_UNSET_RAW_MEM; - char *t = strdup("toto");; + char *t = malloc(5); + t = strdup("toto"); free(t); MC_SET_RAW_MEM; @@ -116,7 +118,8 @@ static void test4() fprintf(stderr, "\n**************** TEST 4 ****************\n\n"); - char *t = strdup("toto"); + char *t = malloc(5); + t = strdup("toto"); MC_SET_RAW_MEM; @@ -237,7 +240,13 @@ void MC_test_snapshot_comparison(){ MC_take_snapshot_liveness(initial); MC_UNSET_RAW_MEM; + /* Get .plt section (start and end addresses) for data libsimgrid comparison */ + get_plt_section(); + test1(); + + MC_restore_snapshot(initial); + MC_UNSET_RAW_MEM; test2(); @@ -260,4 +269,7 @@ void MC_test_snapshot_comparison(){ MC_UNSET_RAW_MEM; test6(); + + MC_restore_snapshot(initial); + MC_UNSET_RAW_MEM; }