From: Marion Guthmuller Date: Thu, 18 Oct 2012 20:09:25 +0000 (+0200) Subject: model-checker : remove files about test_heap_comparison X-Git-Tag: v3_9_rc1~91^2~172 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/31fd837a0980fd05c51f65c3b20018d70e9c2cb4 model-checker : remove files about test_heap_comparison --- diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 0f4a26f1d6..da375fbcb6 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -424,7 +424,6 @@ set(MC_SRC src/mc/mc_request.c src/mc/mc_state.c src/mc/memory_map.c - src/mc/test/heap_comparison.c ) set(headers_to_install diff --git a/examples/msg/mc/CMakeLists.txt b/examples/msg/mc/CMakeLists.txt index 5e267988b7..17cd5c2390 100644 --- a/examples/msg/mc/CMakeLists.txt +++ b/examples/msg/mc/CMakeLists.txt @@ -12,7 +12,6 @@ if(HAVE_MC) add_executable(random_test random_test.c) add_executable(bugged1_liveness bugged1_liveness.c) add_executable(bugged2_liveness bugged2_liveness.c) - add_executable(test/test_heap_comparison test/test_heap_comparison.c) target_link_libraries(centralized simgrid m ) target_link_libraries(bugged1 simgrid m ) @@ -21,7 +20,6 @@ if(HAVE_MC) target_link_libraries(random_test simgrid m ) target_link_libraries(bugged1_liveness simgrid m ) target_link_libraries(bugged2_liveness simgrid m ) - target_link_libraries(test/test_heap_comparison simgrid m ) endif() @@ -55,7 +53,6 @@ set(examples_src ${CMAKE_CURRENT_SOURCE_DIR}/random_test.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_liveness.h ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.h - ${CMAKE_CURRENT_SOURCE_DIR}/test/test_heap_comparison.c PARENT_SCOPE ) set(bin_files diff --git a/examples/msg/mc/test/test_heap_comparison.c b/examples/msg/mc/test/test_heap_comparison.c deleted file mode 100644 index c094f46eaa..0000000000 --- a/examples/msg/mc/test/test_heap_comparison.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "mc/mc.h" -#include "msg/msg.h" - -int main (int argc, char **argv){ - MSG_init(&argc, argv); - MC_test_heap_comparison(); - return 0; -} diff --git a/src/mc/test/heap_comparison.c b/src/mc/test/heap_comparison.c deleted file mode 100644 index 48d343d29a..0000000000 --- a/src/mc/test/heap_comparison.c +++ /dev/null @@ -1,272 +0,0 @@ -#include "../mc_private.h" - -static void test1(void); -static void test2(void); -static void test2(void); -static void test4(void); -static void test5(void); -static void test6(void); - -static void test1() -{ - - fprintf(stderr, "\n**************** TEST 1 ****************\nNo modification (successive snapshot)\n"); - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) == 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 1 ****************\n"); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - -static void test2() -{ - - fprintf(stderr, "\n**************** TEST 2 ****************\nMalloc after first snapshot\n"); - - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - MC_UNSET_RAW_MEM; - - char* t = malloc(50); - t = strdup("toto"); - - MC_SET_RAW_MEM; - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) != 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 2 ****************\n"); - - free(t); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - -static void test3() -{ - - fprintf(stderr, "\n**************** TEST 3 ****************\nMalloc and free after first snapshot\n"); - - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - MC_UNSET_RAW_MEM; - - char *t = malloc(5); - t = strdup("toto"); - free(t); - - MC_SET_RAW_MEM; - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) == 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 3 ****************\n"); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - -static void test4() -{ - - fprintf(stderr, "\n**************** TEST 4 ****************\nMalloc before first snapshot and free after first snapshot\n"); - - char *t = malloc(5); - t = strdup("toto"); - - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - MC_UNSET_RAW_MEM; - - free(t); - - MC_SET_RAW_MEM; - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) != 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 4 ****************\n"); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - - -static void test5() -{ - - fprintf(stderr, "\n**************** TEST 5 ****************\nMalloc before first snapshot and increment pointer after first snapshot\n"); - - char *ptr1 = malloc(sizeof(char *)); - - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - MC_UNSET_RAW_MEM; - - *ptr1 = *ptr1 + 1; - - MC_SET_RAW_MEM; - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) != 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 5 ****************\n"); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - -static void test6() -{ - - fprintf(stderr, "\n**************** TEST 6 ****************\nMalloc before first snapshot and increment then decrement pointer after first snapshot\n"); - - char *ptr1 = malloc(sizeof(char *)); - - MC_SET_RAW_MEM; - - /* Save first snapshot */ - mc_snapshot_t snapshot1 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot1); - - MC_UNSET_RAW_MEM; - - *ptr1 = *ptr1 + 1; - *ptr1 = *ptr1 - 1; - - MC_SET_RAW_MEM; - - /* Save second snapshot */ - mc_snapshot_t snapshot2 = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(snapshot2); - - xbt_assert(snapshot_compare(snapshot1, snapshot2) == 0); - - MC_UNSET_RAW_MEM; - - fprintf(stderr, "\n**************** END TEST 6 ****************\n"); - - MC_SET_RAW_MEM; - - MC_free_snapshot(snapshot1); - MC_free_snapshot(snapshot2); - - MC_UNSET_RAW_MEM; -} - - -void MC_test_heap_comparison(){ - - MC_memory_init(); - - MC_SET_RAW_MEM; - - mc_snapshot_t initial = xbt_new0(s_mc_snapshot_t, 1); - MC_take_snapshot_liveness(initial); - - MC_UNSET_RAW_MEM; - - /* Get .plt section (start and end addresses) for data libsimgrid and data program comparison */ - get_libsimgrid_plt_section(); - get_binary_plt_section(); - - test1(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; - - test2(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; - - test3(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; - - test4(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; - - test5(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; - - test6(); - - MC_restore_snapshot(initial); - MC_UNSET_RAW_MEM; -}