-
Notifications
You must be signed in to change notification settings - Fork 277
De-randomize assertion ordering in plain report #5206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I imagine some tests will have to be updated?
return id2string(p1.get_function()) < id2string(p2.get_function()); | ||
else if( | ||
!p1.get_line().empty() && !p2.get_line().empty() && | ||
p1.get_line() != p2.get_line()) | ||
return std::stoul(id2string(p1.get_line())) < | ||
std::stoul(id2string(p2.get_line())); | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it’d probably be better to sort ids numerically (by the number at the end) rather than lexicographically here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me, pending un-drafting and passing CI, of course :-)
Codecov Report
@@ Coverage Diff @@
## develop #5206 +/- ##
===========================================
+ Coverage 67.37% 67.37% +<.01%
===========================================
Files 1157 1157
Lines 95072 95087 +15
===========================================
+ Hits 64054 64068 +14
- Misses 31018 31019 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable and removing this unnecessary platform non-determinism seems good. I am a little concerned about what this might break in test suites but I guess we will see.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: 26f6282).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/140982791
796d726
to
6c3ae51
Compare
specifically order also based on function-name and only compare line number if they differ. Moreover, we extend the id comparison to be alphabetical for the assertion name and numerical for the number part.
6c3ae51
to
ed498df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: ed498df).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/141450413
specifically order also based on function-name and only compare line number if they differ.