X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/01dd1d293c39ba31c3e509cf413c11fc991a0043..e4465c97e74bf0a2ac06737edfe4384e0ac1f354:/examples/simdag/dot/dot_test2.c diff --git a/examples/simdag/dot/dot_test2.c b/examples/simdag/dot/dot_test2.c index 47f327a8c4..38b70958b8 100644 --- a/examples/simdag/dot/dot_test2.c +++ b/examples/simdag/dot/dot_test2.c @@ -1,6 +1,6 @@ /* simple test trying to load a DOT file. */ -/* Copyright (c) 2010-2015. The SimGrid Team. +/* Copyright (c) 2010-2016. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -13,8 +13,7 @@ #include "xbt/ex.h" #include -XBT_LOG_NEW_DEFAULT_CATEGORY(test, - "Logging specific to this SimDag example"); +XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Logging specific to this SimDag example"); int main(int argc, char **argv) { @@ -26,27 +25,21 @@ int main(int argc, char **argv) SD_init(&argc, argv); /* Check our arguments */ - if (argc < 2) { - XBT_INFO("Usage: %s dot_file", argv[0]); - exit(1); - } + xbt_assert(argc > 1, "Usage: %s dot_file", argv[0]); /* load the DOT file */ dot = SD_dotload(argv[1]); /* Display all the tasks */ - XBT_INFO - ("------------------- Display all tasks of the loaded DAG ---------------------------"); + XBT_INFO("------------------- Display all tasks of the loaded DAG ---------------------------"); xbt_dynar_foreach(dot, cursor, task) { SD_task_dump(task); } - XBT_INFO - ("--------------------- Transform the dynar into an array ---------------------------"); + XBT_INFO("--------------------- Transform the dynar into an array ---------------------------"); cursor=0; dot_as_array = (SD_task_t*) xbt_dynar_to_array(dot); - XBT_INFO - ("----------------------------- dump tasks again ------------------------------------"); + XBT_INFO("----------------------------- dump tasks again ------------------------------------"); while ((task=dot_as_array[cursor++])){ SD_task_dump(task); }