From f568937133426a7ec961acb80c4c205246d98b85 Mon Sep 17 00:00:00 2001 From: Martin Janiczek Date: Tue, 17 Oct 2023 20:36:33 +0200 Subject: [PATCH] LibTest: Remove the redefinition of VERIFY family of macros Previously VERIFY et al. was redefined inside tests to not abort and instead fail the test. This wouldn't apply to non-header code though, and was not helpful, as it prevented you from easily attaching gdb near the abort. After this removal tests can still use the EXPECT family of macros, but VERIFY will behave like it does in the rest of the codebase (abort etc.). --- Userland/Libraries/LibTest/Macros.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Userland/Libraries/LibTest/Macros.h b/Userland/Libraries/LibTest/Macros.h index ee500be6889..0a43ec8977b 100644 --- a/Userland/Libraries/LibTest/Macros.h +++ b/Userland/Libraries/LibTest/Macros.h @@ -22,29 +22,6 @@ namespace Test { void current_test_case_did_fail(); } -#undef VERIFY -#define VERIFY(x) \ - do { \ - if (!(x)) { \ - ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: VERIFY({}) failed", __FILE__, __LINE__, #x); \ - ::Test::current_test_case_did_fail(); \ - } \ - } while (false) - -#undef VERIFY_NOT_REACHED -#define VERIFY_NOT_REACHED() \ - do { \ - ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: VERIFY_NOT_REACHED() called", __FILE__, __LINE__); \ - ::abort(); \ - } while (false) - -#undef TODO -#define TODO() \ - do { \ - ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: TODO() called", __FILE__, __LINE__); \ - ::abort(); \ - } while (false) - #define EXPECT_EQ(a, b) \ do { \ auto lhs = (a); \