From: Martin Quinson Date: Thu, 2 Mar 2017 20:35:59 +0000 (+0100) Subject: sonar is picky, so let's be verbose X-Git-Tag: v3_15~238 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/acac7aa68c0c8fb3a534e04fecf11f6e143678c5 sonar is picky, so let's be verbose --- diff --git a/include/simgrid/s4u/file.hpp b/include/simgrid/s4u/file.hpp index ecb52c917e..1c552d1fe5 100644 --- a/include/simgrid/s4u/file.hpp +++ b/include/simgrid/s4u/file.hpp @@ -13,7 +13,6 @@ namespace simgrid { namespace s4u { -class Actor; class Storage; /** @brief A simulated file diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 1fd0a66482..6aef8bbe3b 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -707,10 +707,18 @@ void STag_surfxml_link___ctn(){ } xbt_free(link_name); // no-op if it's already nullptr - surf_parse_assert(link!=nullptr,"No such link: '%s'%s", A_surfxml_link___ctn_id, - A_surfxml_link___ctn_direction==A_surfxml_link___ctn_direction_UP?" (upward)": - ( A_surfxml_link___ctn_direction==A_surfxml_link___ctn_direction_DOWN?" (downward)": - "")); + const char* dirname = ""; + switch (A_surfxml_link___ctn_direction) { + case A_surfxml_link___ctn_direction_UP: + dirname = " (upward)"; + break; + case A_surfxml_link___ctn_direction_DOWN: + dirname = " (downward)"; + break; + default: + dirname = ""; + } + surf_parse_assert(link != nullptr, "No such link: '%s'%s", A_surfxml_link___ctn_id, dirname); parsed_link_list.push_back(link); } diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index d98ac9dc65..bac25059f4 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -322,8 +322,21 @@ static int xbt_test_suite_run(xbt_test_suite_t suite, int verbosity) xbt_dynar_foreach(unit->tests, it_test, test) { file = (test->file != nullptr ? test->file : unit->file); line = (test->line != 0 ? test->line : unit->line); - fprintf(stderr, " %s: %s [%s:%d]\n", (test->ignored ? " SKIP" : (test->expected_failure - ? (test-> failed ? "EFAIL" : "EPASS") : (test->failed ? " FAIL" : " PASS"))),test->title, file, line); + const char* resname; + if (test->ignored) + resname = " SKIP"; + else if (test->expected_failure) { + if (test->failed) + resname = "EFAIL"; + else + resname = "EPASS"; + } else { + if (test->failed) + resname = " FAIL"; + else + resname = " PASS"; + } + fprintf(stderr, " %s: %s [%s:%d]\n", resname, test->title, file, line); if ((test->expected_failure && !test->failed) || (!test->expected_failure && test->failed)) { xbt_dynar_foreach(test->logs, it_log, log) {