You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without sacrificing the simplicity of ZEN_EXPECT(expression) for the most common cases as well as staying backward compatible.
Other benefits of these constructs should be the ability to see the exact value of x at failure; for floating-point comparisons, and other special cases, specialized macros can provide tailored behavior that a universal macro cannot. For example, EXPECT_FLOAT_EQ and EXPECT_DOUBLE_EQ take into account the precision issues inherent in floating-point arithmetic, offering a more appropriate comparison than a straightforward equality check, and maybe more.
Sir, I have added an argument in ZEN_EXPECT to log the value when it fails, as you mentioned in the issue.
So whenever the macro is used it should contain 2 arguments instead of one.
I have made the changes accordingly. Please review it. Committed the changes in same branch
This will allow expressions like:
Without sacrificing the simplicity of
ZEN_EXPECT(expression)
for the most common cases as well as staying backward compatible.Other benefits of these constructs should be the ability to see the exact value of
x
at failure; for floating-point comparisons, and other special cases, specialized macros can provide tailored behavior that a universal macro cannot. For example,EXPECT_FLOAT_EQ
andEXPECT_DOUBLE_EQ
take into account the precision issues inherent in floating-point arithmetic, offering a more appropriate comparison than a straightforward equality check, and maybe more.Use this advice as a starting point.
The text was updated successfully, but these errors were encountered: