-
Couldn't load subscription status.
- Fork 50
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hi,
One thing that I currently use pretty often (especially for networking code) is:
if (!AssertTrue(a > 3)) {
// Handle the failed assertion in release
return;
}This allows crashing in debug builds during testing but handling it without crashing for users in release builds.
It looks very similar to:
if (!ASSERT_VAL(a > 3))but ASSERT_VAL returns the value of a, not the result of the whole expression a > 3.
Obviously it's possible to do
if (ASSERT_VAL(a > 3) <= 3)but that makes it complicated and error-prone.
Would it be possible to return the result of the whole expression from ASSERT, or to create a variant of the macro (e.g. ASSERT_THAT) that returns the result?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request