• Deomid Ryabkov's avatar
    Make sure test assertions are evaluated once · a3c4a48e
    Deomid Ryabkov authored
    E.g. if `ASSERT_EQ(myfunc(), 123)` fails, `myfunc()` would be invoked again to print the actual value.
    This can cause confusion sometimes.
    To avoid this, we cast arguments to double, which is wide enough for most cases and we provide a variant for 64 bit value types for when it's not.
    We also perform a check and fail if argument to the check results in loss of precision.
    
    CL: none
    
    PUBLISHED_FROM=a14551289d92e8a5dead21d16471ebddebe938a8
    a3c4a48e
test_util.h 10.5 KB