From bbf75823fbe657eda9739c3be6c1715c3041f056 Mon Sep 17 00:00:00 2001 From: suter Date: Tue, 26 Jun 2012 13:15:56 +0200 Subject: [PATCH] test also the dotloader with a file that comprises a cycle. --- examples/simdag/dot/dot_test.c | 3 +-- examples/simdag/dot/test_simdag_dotload.tesh | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/simdag/dot/dot_test.c b/examples/simdag/dot/dot_test.c index def253b4fd..b94ff9f5d7 100644 --- a/examples/simdag/dot/dot_test.c +++ b/examples/simdag/dot/dot_test.c @@ -50,8 +50,7 @@ int main(int argc, char **argv) /* load the DOT file */ dot = SD_dotload(argv[2]); if(dot == NULL){ - XBT_INFO("No dot load may be you have a cycle in your graph"); - return -1; + xbt_die("No dot load may be you have a cycle in your graph"); } /* Display all the tasks */ diff --git a/examples/simdag/dot/test_simdag_dotload.tesh b/examples/simdag/dot/test_simdag_dotload.tesh index 097197500b..5a6aae00cc 100644 --- a/examples/simdag/dot/test_simdag_dotload.tesh +++ b/examples/simdag/dot/test_simdag_dotload.tesh @@ -470,3 +470,17 @@ $ cat ${srcdir:=.}/dag_with_good_schedule.trace > [18.001306] C2-05 compute 0.000000 # end $ rm -f ${srcdir:=.}/dag_with_good_schedule.trace + +! expect signal SIGABRT +$ $SG_TEST_EXENV ./dot_test --log=no_loc ${srcdir:=.}/../2clusters.xml ${srcdir:=.}/dag_with_cycle.dot +> [0.000000] [surf_workstation/INFO] surf_workstation_model_init_ptask_L07 +> [0.000000] [sd_daxparse/WARNING] the task root is not marked +> [0.000000] [sd_daxparse/WARNING] the task 0 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 1 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 2 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 3 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 4 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 5 is in a cycle +> [0.000000] [sd_daxparse/WARNING] the task 6 is in a cycle +> [0.000000] [sd_dotparse/ERROR] The DOT described in dag_with_cycle.dot is not a DAG. It contains a cycle. +> [0.000000] [xbt/CRITICAL] No dot load may be you have a cycle in your graph -- 2.20.1