TestSuite: Actually print failed comparions.. :^)

This commit is contained in:
Andreas Kling 2019-08-01 16:22:20 +02:00
parent eeff0cd570
commit 8434548f14

View file

@ -4,6 +4,7 @@
#include "Function.h" #include "Function.h"
#include "NonnullRefPtrVector.h" #include "NonnullRefPtrVector.h"
#include <chrono> #include <chrono>
#include <stdio.h>
namespace AK { namespace AK {
@ -235,13 +236,13 @@ using AK::TestSuite;
TestSuite::release(); \ TestSuite::release(); \
} }
#define assertEqual(one, two) \ #define assertEqual(one, two) \
do { \ do { \
auto ___aev1 = one; \ auto ___aev1 = one; \
auto ___aev2 = two; \ auto ___aev2 = two; \
if (___aev1 != ___aev2) { \ if (___aev1 != ___aev2) { \
const auto& msg = String::format("\033[31;1mFAIL\033[0m: assertEqual(" ___str(one) ", " ___str(two) ") failed"); \ dbg() << TStyle(TStyle::Red, TStyle::Bold) << "FAIL" << TStyle() << ": " __FILE__ ":" << __LINE__ << ": assertEqual(" ___str(one) ", " ___str(two) ") failed"; \
} \ } \
} while (0) } while (0)
#define EXPECT_EQ(one, two) assertEqual(one, two) #define EXPECT_EQ(one, two) assertEqual(one, two)