1 /* Copyright (c) 2012. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include <simgrid/modelchecker.h>
11 XBT_LOG_NEW_DEFAULT_CATEGORY(snapshot_comparison_liveness5, "Debug information for snasphot comparison liveness5 test example");
13 int test(int argc, char **argv);
15 int test(int argc, char **argv){
19 XBT_INFO("**** Start test ****");
20 XBT_INFO("Increment local variable");
23 XBT_INFO("j = %d", j);
25 void *snap1 = MC_snapshot();
29 XBT_INFO("First snapshot");
32 XBT_INFO("j = %d", j);
34 void *snap2 = MC_snapshot();
38 XBT_INFO("Second snapshot");
40 MC_ignore_stack("snap2", "test");
41 MC_ignore_stack("snap1", "test");
43 XBT_INFO("Test result : %d (0 = state equality, 1 = different states)", MC_compare_snapshots(snap1, snap2));
45 XBT_INFO("**** End test ****");
50 int main(int argc, char **argv){
51 MSG_init(&argc, argv);
53 MSG_config("model-check/property","promela");
55 MSG_create_environment("snapshot_comparison_platform.xml");
57 MSG_function_register("test", test);
59 MSG_launch_application("deploy_snapshot_comparison.xml");