diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-22 23:37:10 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-23 11:24:55 +0200 |
commit | 53abc626c2a3d01481089d2c4a3e9018140658e9 (patch) | |
tree | f751414b03cc2c8faae86a5c0ba258118aa83573 /AK/StdLibExtras.h | |
parent | bedd15c3403849df3c386a540c4faa00b4c14602 (diff) | |
download | serenity-53abc626c2a3d01481089d2c4a3e9018140658e9.zip |
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"
Diffstat (limited to 'AK/StdLibExtras.h')
-rw-r--r-- | AK/StdLibExtras.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 4b38a7764c..cf13cfbf7a 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -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; |