Skip to content

Commit 26f6282

Browse files
committed
De-randomize assertion ordering in plain report
specifically order also based on function-name and only compare line number if they differ.
1 parent bcde700 commit 26f6282

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goto-checker/report_util.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ get_sorted_properties(const propertiest &properties)
198198
const auto &p2 = pit2->second.pc->source_location;
199199
if(p1.get_file() != p2.get_file())
200200
return id2string(p1.get_file()) < id2string(p2.get_file());
201-
else if(!p1.get_line().empty() && !p2.get_line().empty())
201+
if(p1.get_function() != p2.get_function())
202+
return id2string(p1.get_function()) < id2string(p2.get_function());
203+
else if(
204+
!p1.get_line().empty() && !p2.get_line().empty() &&
205+
p1.get_line() != p2.get_line())
202206
return std::stoul(id2string(p1.get_line())) <
203207
std::stoul(id2string(p2.get_line()));
204208
else

0 commit comments

Comments
 (0)