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

LibTest: Add EXPECT_NE(..) test assertion.

This commit is contained in:
Brian Gianforcaro 2021-04-28 19:53:24 -07:00 committed by Andreas Kling
parent adcd56473c
commit 2cef015528

View file

@ -65,6 +65,16 @@ void current_test_case_did_fail();
} \
} while (false)
#define EXPECT_NE(a, b) \
do { \
auto lhs = (a); \
auto rhs = (b); \
if (lhs == rhs) { \
::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: EXPECT_NE({}, {}) failed with lhs={} and rhs={}", __FILE__, __LINE__, #a, #b, FormatIfSupported { lhs }, FormatIfSupported { rhs }); \
::Test::current_test_case_did_fail(); \
} \
} while (false)
#define EXPECT(x) \
do { \
if (!(x)) { \