X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf108868b4eeed4d0d9d343bc68557d7814e18c0..05a81a473f36ee2298730ccc85d4033affad4018:/teshsuite/msg/trace/test_trace_integration.c diff --git a/teshsuite/msg/trace/test_trace_integration.c b/teshsuite/msg/trace/test_trace_integration.c index d0f52cf28c..c39732a5e8 100644 --- a/teshsuite/msg/trace/test_trace_integration.c +++ b/teshsuite/msg/trace/test_trace_integration.c @@ -4,21 +4,13 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include -#include #include "simgrid/msg.h" -#include "xbt/log.h" -#include "xbt/asserts.h" -XBT_LOG_NEW_DEFAULT_CATEGORY(test_trace_integration, - "Messages specific for this msg example"); - -int test_trace(int argc, char *argv[]); +XBT_LOG_NEW_DEFAULT_CATEGORY(test_trace_integration, "Messages specific for this msg example"); /** test the trace integration cpu model */ -int test_trace(int argc, char *argv[]) +static int test_trace(int argc, char *argv[]) { - msg_task_t task; double task_comp_size = 2800; double task_prio = 1.0; @@ -32,7 +24,7 @@ int test_trace(int argc, char *argv[]) XBT_INFO("Task prio: %f", task_prio); /* Create and execute a single task. */ - task = MSG_task_create("proc 0", task_comp_size, 0, NULL); + msg_task_t task = MSG_task_create("proc 0", task_comp_size, 0, NULL); MSG_task_set_priority(task, task_prio); MSG_task_execute(task); MSG_task_destroy(task); @@ -42,21 +34,17 @@ int test_trace(int argc, char *argv[]) return 0; } -/** Main function */ int main(int argc, char *argv[]) { msg_error_t res = MSG_OK; - /* Verify if the platform xml file was passed by command line. */ MSG_init(&argc, argv); xbt_assert(argc > 2, "Usage: %s test_trace_integration_model.xml deployment.xml\n", argv[0]); - /* Register SimGrid process function. */ MSG_function_register("test_trace", test_trace); - /* Use the same file for platform and deployment. */ MSG_create_environment(argv[1]); MSG_launch_application(argv[2]); - /* Run the example. */ + res = MSG_main(); return res != MSG_OK;