summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTest
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-07-17 18:29:28 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-19 16:34:21 +0430
commited46d52252375be732841d980f9eec02ea7691f5 (patch)
tree60c8ff281cb3a07e2a33629184c6c0aec2a7f528 /Userland/Libraries/LibTest
parentc5f6ba6e71ee7ebce578828fd35ba119e9a6b41a (diff)
downloadserenity-ed46d52252375be732841d980f9eec02ea7691f5.zip
Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
Diffstat (limited to 'Userland/Libraries/LibTest')
-rw-r--r--Userland/Libraries/LibTest/Macros.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibTest/Macros.h b/Userland/Libraries/LibTest/Macros.h
index 6a38eadfcf..9c084e46a3 100644
--- a/Userland/Libraries/LibTest/Macros.h
+++ b/Userland/Libraries/LibTest/Macros.h
@@ -9,6 +9,7 @@
#include <AK/Assertions.h>
#include <AK/CheckedFormatString.h>
+#include <AK/Math.h>
#include <LibTest/CrashTest.h>
namespace AK {
@@ -89,7 +90,7 @@ void current_test_case_did_fail();
auto expect_close_lhs = a; \
auto expect_close_rhs = b; \
auto expect_close_diff = static_cast<double>(expect_close_lhs) - static_cast<double>(expect_close_rhs); \
- if (fabs(expect_close_diff) > 0.0000005) { \
+ if (AK::fabs(expect_close_diff) > 0.0000005) { \
::AK::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); \