diff --git a/AK/Assertions.h b/AK/Assertions.h index 976e36e60cc..352ab090e01 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -26,18 +26,14 @@ #pragma once -#ifndef AK_TEST_SUITE - -# if defined(KERNEL) -# include -# else -# include -# ifndef __serenity__ -# define ASSERT assert -# define ASSERT_NOT_REACHED() assert(false) -# define RELEASE_ASSERT assert -# define TODO ASSERT_NOT_REACHED -# endif +#if defined(KERNEL) +# include +#else +# include +# ifndef __serenity__ +# define ASSERT assert +# define ASSERT_NOT_REACHED() assert(false) +# define RELEASE_ASSERT assert +# define TODO ASSERT_NOT_REACHED # endif - #endif diff --git a/AK/TestSuite.h b/AK/TestSuite.h index 623f6669537..0eee0be61a8 100644 --- a/AK/TestSuite.h +++ b/AK/TestSuite.h @@ -26,7 +26,7 @@ #pragma once -#define AK_TEST_SUITE +#include namespace AK { @@ -37,39 +37,40 @@ void warnln(const char* fmtstr, const Parameters&...); using AK::warnln; +#undef ASSERT #define ASSERT(x) \ do { \ if (!(x)) \ ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: ASSERT({}) failed", __FILE__, __LINE__, #x); \ } while (false) +#undef RELEASE_ASSERT #define RELEASE_ASSERT(x) \ do { \ if (!(x)) \ ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: RELEASE_ASSERT({}) failed", __FILE__, __LINE__, #x); \ } while (false) +#undef ASSERT_NOT_REACHED #define ASSERT_NOT_REACHED() \ do { \ ::AK::warnln("\033[31;1mFAIL\033[0m: {}:{}: ASSERT_NOT_REACHED() called", __FILE__, __LINE__); \ ::abort(); \ } while (false) +#undef TODO #define TODO() \ do { \ ::AK::warnln(stderr, "\033[31;1mFAIL\033[0m: {}:{}: TODO() called", __FILE__, __LINE__); \ ::abort(); \ } while (false) -#include - #include #include #include #include - #include - +#include #include namespace AK { diff --git a/AK/Tests/TestStringUtils.cpp b/AK/Tests/TestStringUtils.cpp index f5760f4b0f0..952fa496f6d 100644 --- a/AK/Tests/TestStringUtils.cpp +++ b/AK/Tests/TestStringUtils.cpp @@ -24,9 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include +#include + TEST_CASE(matches_null) { EXPECT(AK::StringUtils::matches(StringView(), StringView()));