mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
LibTest: Add EXPECT_NE(..) test assertion.
This commit is contained in:
parent
adcd56473c
commit
2cef015528
1 changed files with 10 additions and 0 deletions
|
@ -65,6 +65,16 @@ void current_test_case_did_fail();
|
||||||
} \
|
} \
|
||||||
} while (false)
|
} 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) \
|
#define EXPECT(x) \
|
||||||
do { \
|
do { \
|
||||||
if (!(x)) { \
|
if (!(x)) { \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue