Skip to content

Commit 4f0653f

Browse files
committed
Intermediate changes
commit_hash:2cae4f8b8ad560eb417e09ac5ff75d2c9df3cb59
1 parent b4ef2d5 commit 4f0653f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

util/generic/typelist_ut.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
#include "typelist.h"
55
#include "vector.h"
66

7+
template <class A, class B>
8+
void UnitAssertTypesEqual()
9+
{
10+
UNIT_ASSERT_TYPES_EQUAL(A, B);
11+
}
12+
713
class TTypeListTest: public TTestBase {
814
UNIT_TEST_SUITE(TTypeListTest);
915
UNIT_TEST(TestSimple);
@@ -83,16 +89,16 @@ class TTypeListTest: public TTestBase {
8389
}
8490

8591
void TestUnique() {
86-
static_assert(std::is_same_v<NTL::TUnique<TSignedInts>::type, TSignedInts>);
87-
static_assert(std::is_same_v<typename NTL::TUnique<typename NTL::TConcat<TSignedInts, TSignedInts>::type>::type, TSignedInts>);
92+
UnitAssertTypesEqual<NTL::TUnique<TSignedInts>::type, TSignedInts>();
93+
UnitAssertTypesEqual<typename NTL::TUnique<typename NTL::TConcat<TSignedInts, TSignedInts>::type>::type, TSignedInts>();
8894
}
8995

9096
void TestUniqueTypeList() {
91-
static_assert(std::is_same_v<TUniqueTypeList<int>, TTypeList<int>>);
92-
static_assert(std::is_same_v<TUniqueTypeList<int, int, int, int, int, int, int, int, int>, TTypeList<int>>);
93-
static_assert(std::is_same_v<TUniqueTypeList<TSignedInts>, TTypeList<TSignedInts>>);
94-
static_assert(std::is_same_v<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TTypeList<TSignedInts>>);
95-
static_assert(std::is_same_v<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts>>);
97+
UnitAssertTypesEqual<TUniqueTypeList<int>, TTypeList<int>>();
98+
UnitAssertTypesEqual<TUniqueTypeList<int, int, int, int, int, int, int, int, int>, TTypeList<int>>();
99+
UnitAssertTypesEqual<TUniqueTypeList<TSignedInts>, TTypeList<TSignedInts>>();
100+
UnitAssertTypesEqual<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TTypeList<TSignedInts>>();
101+
UnitAssertTypesEqual<TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts, TSignedInts>, TUniqueTypeList<TSignedInts, TSignedInts, TSignedInts>>();
96102
}
97103
};
98104

0 commit comments

Comments
 (0)