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:
parent
5df014b8ff
commit
cf32f29af6
2 changed files with 36 additions and 36 deletions
|
@ -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(); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue