Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : update examples for test snapshot comparison
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 31 Oct 2012 17:50:00 +0000 (18:50 +0100)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Wed, 7 Nov 2012 15:59:31 +0000 (16:59 +0100)
examples/msg/mc/test/snapshot_comparison_liveness2.c
examples/msg/mc/test/snapshot_comparison_liveness3.c
examples/msg/mc/test/snapshot_comparison_liveness4.c
examples/msg/mc/test/snapshot_comparison_liveness5.c

index 969ee85..e81f3f8 100644 (file)
@@ -24,7 +24,7 @@ int test(int argc, char **argv){
   MSG_process_sleep(1);
 
   char *toto = xbt_malloc(5);
-  XBT_INFO("Toto value %s", toto);
+  XBT_INFO("Toto allocated");
 
   void *snap2 = MC_snapshot();
 
@@ -36,6 +36,8 @@ int test(int argc, char **argv){
   
   XBT_INFO("**** End test ****");
 
+  xbt_free(toto);
+
   return 0;
 }
 
index fdf8966..27703a7 100644 (file)
@@ -19,23 +19,26 @@ int test(int argc, char **argv){
   XBT_INFO("**** Start test ****");
   XBT_INFO("Malloc and free after first snapshot");
 
+  char *toto = NULL;
+
   void *snap1 = MC_snapshot();
 
   MSG_process_sleep(1);
 
-  char *toto = NULL;
   toto = xbt_malloc(5);
-  XBT_INFO("Toto value %s", toto);
+  XBT_INFO("Toto allocated");
   xbt_free(toto);
   toto = NULL;
+  XBT_INFO("Toto free");
 
   MSG_process_sleep(1);
 
   void *snap2 = MC_snapshot();
 
-  int res = MC_compare_snapshots(snap1, snap2);
+  MC_ignore_stack("snap2", "test");   
+  MC_ignore_stack("snap1", "test");
 
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", res);
+  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
   
   XBT_INFO("**** End test ****");
 
index f116228..9c38d30 100644 (file)
@@ -20,21 +20,23 @@ int test(int argc, char **argv){
   XBT_INFO("Free after first snapshot");
   
   char *toto = xbt_malloc(5);
-  XBT_INFO("Toto value %s", toto);
+  XBT_INFO("Toto allocated");
 
   void *snap1 = MC_snapshot();
 
   MSG_process_sleep(1);
 
   xbt_free(toto);
+  XBT_INFO("Toto free");
 
   void *snap2 = MC_snapshot();
 
   MSG_process_sleep(1);
+  
+  MC_ignore_stack("snap2", "test");   
+  MC_ignore_stack("snap1", "test");
 
-  int res = MC_compare_snapshots(snap1, snap2);
-
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", res);
+  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
   
   XBT_INFO("**** End test ****");
 
index acb72d1..e8054f7 100644 (file)
@@ -33,9 +33,10 @@ int test(int argc, char **argv){
 
   MSG_process_sleep(1);
 
-  int res = MC_compare_snapshots(snap1, snap2);
+  MC_ignore_stack("snap2", "test");   
+  MC_ignore_stack("snap1", "test");
 
-  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", res);
+  XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
   
   XBT_INFO("**** End test ****");