1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:57:46 +00:00

AK: Print RHS and LHS in EXPECT_EQ if we can

This makes error messages more useful during debugging.

Old:

    START Running test compare_views
    FAIL: ../AK/Tests/TestStringView.cpp:59: EXPECT_EQ(view1, "foobar") failed

New:

    START Running test compare_views
    FAIL: ../AK/Tests/TestStringView.cpp:59: EXPECT_EQ(view1, "foobar") failed: LHS="foo", RHS="foobar"
This commit is contained in:
Ben Wiederhake 2020-08-22 23:37:10 +02:00 committed by Andreas Kling
parent bedd15c340
commit 53abc626c2
2 changed files with 49 additions and 5 deletions

View file

@ -40,7 +40,6 @@ inline constexpr unsigned round_up_to_power_of_two(unsigned value, unsigned powe
namespace AK {
template<typename T, typename SizeType = decltype(sizeof(T)), SizeType N>
constexpr SizeType array_size(T (&)[N])
{
@ -501,6 +500,9 @@ template<typename ReferenceType, typename T>
using CopyConst =
typename Conditional<IsConst<ReferenceType>::value, typename AddConst<T>::Type, typename RemoveConst<T>::Type>::Type;
template<typename... Ts>
using Void = void;
}
using AK::AddConst;
@ -523,3 +525,4 @@ using AK::min;
using AK::move;
using AK::RemoveConst;
using AK::swap;
using AK::Void;