}
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);
}
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) {