|
4 | 4 | #include "typelist.h"
|
5 | 5 | #include "vector.h"
|
6 | 6 |
|
| 7 | +template <class A, class B> |
| 8 | +void UnitAssertTypesEqual() |
| 9 | +{ |
| 10 | + UNIT_ASSERT_TYPES_EQUAL(A, B); |
| 11 | +} |
| 12 | + |
7 | 13 | class TTypeListTest: public TTestBase {
|
8 | 14 | UNIT_TEST_SUITE(TTypeListTest);
|
9 | 15 | UNIT_TEST(TestSimple);
|
@@ -83,16 +89,16 @@ class TTypeListTest: public TTestBase {
|
83 | 89 | }
|
84 | 90 |
|
85 | 91 | 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>(); |
88 | 94 | }
|
89 | 95 |
|
90 | 96 | 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>>(); |
96 | 102 | }
|
97 | 103 | };
|
98 | 104 |
|
|
0 commit comments