mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-12 04:22:28 +00:00
LibTest: Add EXPECT_NE(..) test assertion.
This commit is contained in:
parent
adcd56473c
commit
2cef015528
Notes:
sideshowbarker
2024-07-18 18:55:25 +09:00
Author: https://github.com/bgianfo
Commit: 2cef015528
Pull-request: https://github.com/SerenityOS/serenity/pull/6727
Reviewed-by: https://github.com/linusg
1 changed files with 10 additions and 0 deletions
|
@ -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)) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue