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
In certain test-cases it's necessary to test for an exact float-point value. ASSERT_EQUAL is not suitable for this because it assumes arguments to be integers. ASSERT_FLT_NEAR is not suitable either, because it will accept not equal values.
The workaround I currently use is ASSERT_TRUE(function_under_test() == 1.0f), which works as expected, but is not as readable as ASSERT_EQUAL(function_under_test(), 1.0f).
The text was updated successfully, but these errors were encountered:
How do you propose to implement this? The same ASSERT_EQUAL macro cannot be used, since the function behind it needs to print either 2 floats or 2 integers..
In certain test-cases it's necessary to test for an exact float-point value.
ASSERT_EQUAL
is not suitable for this because it assumes arguments to be integers.ASSERT_FLT_NEAR
is not suitable either, because it will accept not equal values.The workaround I currently use is
ASSERT_TRUE(function_under_test() == 1.0f)
, which works as expected, but is not as readable asASSERT_EQUAL(function_under_test(), 1.0f)
.The text was updated successfully, but these errors were encountered: