From 8434548f14d120ddaba680210d8f25192dd48203 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 1 Aug 2019 16:22:20 +0200 Subject: [PATCH] TestSuite: Actually print failed comparions.. :^) --- AK/TestSuite.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/AK/TestSuite.h b/AK/TestSuite.h index 785669055e..655d073070 100644 --- a/AK/TestSuite.h +++ b/AK/TestSuite.h @@ -4,6 +4,7 @@ #include "Function.h" #include "NonnullRefPtrVector.h" #include +#include namespace AK { @@ -235,13 +236,13 @@ using AK::TestSuite; TestSuite::release(); \ } -#define assertEqual(one, two) \ - do { \ - auto ___aev1 = one; \ - auto ___aev2 = two; \ - if (___aev1 != ___aev2) { \ - const auto& msg = String::format("\033[31;1mFAIL\033[0m: assertEqual(" ___str(one) ", " ___str(two) ") failed"); \ - } \ +#define assertEqual(one, two) \ + do { \ + auto ___aev1 = one; \ + auto ___aev2 = two; \ + if (___aev1 != ___aev2) { \ + dbg() << TStyle(TStyle::Red, TStyle::Bold) << "FAIL" << TStyle() << ": " __FILE__ ":" << __LINE__ << ": assertEqual(" ___str(one) ", " ___str(two) ") failed"; \ + } \ } while (0) #define EXPECT_EQ(one, two) assertEqual(one, two)