1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

AK+LibM: Rename EXPECT_CLOSE to EXPECT_APPROXIMATE

This commit is contained in:
Ben Wiederhake 2021-03-03 18:43:15 +01:00 committed by Andreas Kling
parent 5df014b8ff
commit cf32f29af6
2 changed files with 36 additions and 36 deletions

View file

@ -325,13 +325,13 @@ using AK::TestSuite;
} \
} while (false)
#define EXPECT_CLOSE(a, b) \
#define EXPECT_APPROXIMATE(a, b) \
do { \
auto expect_close_lhs = a; \
auto expect_close_rhs = b; \
auto expect_close_diff = expect_close_lhs - expect_close_rhs; \
if (fabs(expect_close_diff) >= 0.000001) { \
warnln("\033[31;1mFAIL\033[0m: {}:{}: EXPECT_CLOSE({}, {})" \
warnln("\033[31;1mFAIL\033[0m: {}:{}: EXPECT_APPROXIMATE({}, {})" \
" failed with lhs={}, rhs={}, (lhs-rhs)={}", \
__FILE__, __LINE__, #a, #b, expect_close_lhs, expect_close_rhs, expect_close_diff); \
current_test_case_did_fail(); \