Panic utilities improvements: ensure DEBUG_ASSERT compiles, add ASSERT_EQ etc., add tests #571
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves #559
Summary
I didn't add tests before because I thought it would be necessary to test them (in particular the abort feature) via a script from outside which would have been painful; but turns out gtest has ASSERT_DEATH which allows to do this perfectly.
This PR still doesn't extend UNREACHABLE / UNIMPLEMENTED for arguments, which are a bit challenging to do (the 0-ary case does not need to call fmt::format at all, and CPP macros have no easy dispatch on the number of arguments, but I think I know how to do it anyway now; but will only approach this when asked).
PR Checklist