From ca2d61f8f4e7d4f82a4dc9bd909188eeb870bc9f Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Thu, 21 Jun 2012 11:32:41 +0200 Subject: [PATCH] model-checker: remove unused examples --- examples/msg/mc/CMakeLists.txt | 6 --- examples/msg/mc/bugged1_stateful.c | 65 ------------------------ examples/msg/mc/bugged2_stateful.c | 79 ------------------------------ 3 files changed, 150 deletions(-) delete mode 100644 examples/msg/mc/bugged1_stateful.c delete mode 100644 examples/msg/mc/bugged2_stateful.c diff --git a/examples/msg/mc/CMakeLists.txt b/examples/msg/mc/CMakeLists.txt index 34cf083de3..e11ce0b4a0 100644 --- a/examples/msg/mc/CMakeLists.txt +++ b/examples/msg/mc/CMakeLists.txt @@ -5,8 +5,6 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}") add_executable(centralized centralized_mutex.c) add_executable(bugged1 bugged1.c) -add_executable(bugged1_stateful bugged1_stateful.c) -add_executable(bugged2_stateful bugged2_stateful.c) add_executable(bugged2 bugged2.c) add_executable(bugged3 bugged3.c) add_executable(random_test random_test.c) @@ -19,8 +17,6 @@ add_executable(test_snapshot test_snapshot.c) target_link_libraries(centralized simgrid m ) target_link_libraries(bugged1 simgrid m ) -target_link_libraries(bugged1_stateful simgrid m) -target_link_libraries(bugged2_stateful simgrid m) target_link_libraries(bugged2 simgrid m ) target_link_libraries(bugged3 simgrid m ) target_link_libraries(random_test simgrid m ) @@ -56,11 +52,9 @@ set(examples_src ${examples_src} ${CMAKE_CURRENT_SOURCE_DIR}/bugged1.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_for_liveness.c - ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_stateful.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged1_while_liveness.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged2.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_liveness.c - ${CMAKE_CURRENT_SOURCE_DIR}/bugged2_stateful.c ${CMAKE_CURRENT_SOURCE_DIR}/bugged3.c ${CMAKE_CURRENT_SOURCE_DIR}/centralized_liveness.c ${CMAKE_CURRENT_SOURCE_DIR}/centralized_liveness_deadlock.c diff --git a/examples/msg/mc/bugged1_stateful.c b/examples/msg/mc/bugged1_stateful.c deleted file mode 100644 index 4bf0381230..0000000000 --- a/examples/msg/mc/bugged1_stateful.c +++ /dev/null @@ -1,65 +0,0 @@ -/******************** Non-deterministic message ordering *********************/ -/* Server assumes a fixed order in the reception of messages from its clients */ -/* which is incorrect because the message ordering is non-deterministic */ -/******************************************************************************/ - -#include -#include -#define N 3 - -XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example"); - -int server(int argc, char *argv[]); -int client(int argc, char *argv[]); - -int server(int argc, char *argv[]) -{ - m_task_t task = NULL; - int count = 0; - while (count < N) { - if (task) { - MSG_task_destroy(task); - task = NULL; - } - MSG_task_receive(&task, "mymailbox"); - count++; - } - MC_assert_stateful(atoi(MSG_task_get_name(task)) == 3); - - XBT_INFO("OK"); - return 0; -} - -int client(int argc, char *argv[]) -{ - - m_task_t task = - MSG_task_create(argv[1], 0 /*comp cost */ , 10000 /*comm size */ , - NULL /*arbitrary data */ ); - - MSG_task_send(task, "mymailbox"); - - XBT_INFO("Sent!"); - return 0; -} - -int main(int argc, char *argv[]) -{ - - MSG_global_init(&argc, argv); - - MSG_create_environment("platform.xml"); - - MSG_function_register("server", server); - - MSG_function_register("client", client); - - MSG_launch_application("deploy_bugged1.xml"); - - MSG_main_stateful(); - - MSG_clean(); - - return 0; - -} diff --git a/examples/msg/mc/bugged2_stateful.c b/examples/msg/mc/bugged2_stateful.c deleted file mode 100644 index 8c6df80f40..0000000000 --- a/examples/msg/mc/bugged2_stateful.c +++ /dev/null @@ -1,79 +0,0 @@ -/******************** Non-deterministic message ordering *********************/ -/* Server assumes a fixed order in the reception of messages from its clients */ -/* which is incorrect because the message ordering is non-deterministic */ -/******************************************************************************/ - -#include -#include -#define N 3 - -XBT_LOG_NEW_DEFAULT_CATEGORY(example, "this example"); - -int server(int argc, char *argv[]); -int client(int argc, char *argv[]); - -int server(int argc, char *argv[]) -{ - m_task_t task1, task2; - long val1, val2; - - MSG_task_receive(&task1, "mymailbox"); - val1 = (long) MSG_task_get_data(task1); - MSG_task_destroy(task1); - task1 = NULL; - XBT_INFO("Received %lu", val1); - - MSG_task_receive(&task2, "mymailbox"); - val2 = (long) MSG_task_get_data(task2); - MSG_task_destroy(task2); - task2 = NULL; - XBT_INFO("Received %lu", val2); - - MC_assert_stateful(min(val1, val2) == 1); - - MSG_task_receive(&task1, "mymailbox"); - val1 = (long) MSG_task_get_data(task1); - MSG_task_destroy(task1); - XBT_INFO("Received %lu", val1); - - MSG_task_receive(&task2, "mymailbox"); - val2 = (long) MSG_task_get_data(task2); - MSG_task_destroy(task2); - XBT_INFO("Received %lu", val2); - - XBT_INFO("OK"); - return 0; -} - -int client(int argc, char *argv[]) -{ - m_task_t task1 = - MSG_task_create("task", 0, 10000, (void *) atol(argv[1])); - m_task_t task2 = - MSG_task_create("task", 0, 10000, (void *) atol(argv[1])); - - XBT_INFO("Send %d!", atoi(argv[1])); - MSG_task_send(task1, "mymailbox"); - - XBT_INFO("Send %d!", atoi(argv[1])); - MSG_task_send(task2, "mymailbox"); - - return 0; -} - -int main(int argc, char *argv[]) -{ - MSG_global_init(&argc, argv); - - MSG_create_environment("platform.xml"); - - MSG_function_register("server", server); - - MSG_function_register("client", client); - - MSG_launch_application("deploy_bugged2.xml"); - - MSG_main_stateful(); - - return 0; -} -- 2.20.1