fixed test not running

This commit is contained in:
Patrick 2024-07-22 20:35:37 +02:00
parent 6a05192db3
commit 46bf398a78
1 changed files with 12 additions and 18 deletions

View File

@ -6,9 +6,9 @@
#define ASSERT_ALL_VEC_EQ(vec, eq) ASSERT_ALL_EQ((vec).begin(), (vec).end(), eq) #define ASSERT_ALL_VEC_EQ(vec, eq) ASSERT_ALL_EQ((vec).begin(), (vec).end(), eq)
#define ASSERT_RANGE_VEC_EQ(vec, startI, endI, eq) ASSERT_ALL_EQ(((vec).data() + startI), ((vec).data() + endI), eq) #define ASSERT_RANGE_VEC_EQ(vec, startI, endI, eq) ASSERT_ALL_EQ(((vec).data() + startI), ((vec).data() + endI), eq)
#define ASSERT_VEC_ARR_EQ(vec, eq) ASSERT_C_ARR_EQ((vec).data(), (vec).data() + (vec).size(), eq) #define ASSERT_VEC_ARR_EQ(vec, eq) ASSERT_C_ARR_EQ((vec).data(), (vec).data() + (vec).size(), std::begin(eq))
#define ASSERT_VEC_EQ(vec1, vec2) ASSERT_C_ARR_EQ((vec1).data(), (vec1).data() + (vec1).size(), (vec2).data()) #define ASSERT_VEC_EQ(vec1, vec2) ASSERT_C_ARR_EQ((vec1).data(), (vec1).data() + (vec1).size(), (vec2).data())
#define ASSERT_RANGE_VEC_ARR_EQ(vec, startI, endI, eq) ASSERT_C_ARR_EQ(((vec).begin() + startI), ((vec).begin() + endI), (eq)) #define ASSERT_RANGE_VEC_ARR_EQ(vec, startI, endI, eq) ASSERT_C_ARR_EQ(((vec).begin() + startI), ((vec).begin() + endI), std::begin(eq))
constexpr test_suite tests = define_tests("Tests") constexpr test_suite tests = define_tests("Tests")
("const_vector()", []() constexpr { ("const_vector()", []() constexpr {
@ -64,8 +64,6 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(T &value)", []() constexpr { ("const_vector(T &value)", []() constexpr {
cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi1(test_defs::get<int>::value<1>()); cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi1(test_defs::get<int>::value<1>());
cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi2(test_defs::get<int>::value<2>()); cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi2(test_defs::get<int>::value<2>());
@ -165,9 +163,7 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(const value_type (&array)[N])", []() constexpr {
("const_vector(const value_type (&array)[N])", []() constexpr{
cc::const_vector vi1(test_defs::get<int>::arr<1>); cc::const_vector vi1(test_defs::get<int>::arr<1>);
cc::const_vector vi2(test_defs::get<int>::arr<2>); cc::const_vector vi2(test_defs::get<int>::arr<2>);
@ -249,13 +245,14 @@ constexpr test_suite tests = define_tests("Tests")
ASSERT_RANGE_VEC_EQ(vo3, test_defs::get<TestStruct>::arr_len<1>(), test_defs::get<int>::capacity<1>(), TestStruct {}); ASSERT_RANGE_VEC_EQ(vo3, test_defs::get<TestStruct>::arr_len<1>(), test_defs::get<int>::capacity<1>(), TestStruct {});
ASSERT_RANGE_VEC_ARR_EQ(vo4, 0, test_defs::get<TestStruct>::arr_len<2>(), test_defs::get<TestStruct>::arr<2>); ASSERT_RANGE_VEC_ARR_EQ(vo4, 0, test_defs::get<TestStruct>::arr_len<2>(), test_defs::get<TestStruct>::arr<2>);
ASSERT_RANGE_VEC_EQ(vo4, test_defs::get<TestStruct>::arr_len<2>(), test_defs::get<int>::capacity<2>(), TestStruct {});*/ ASSERT_RANGE_VEC_EQ(vo4, test_defs::get<TestStruct>::arr_len<2>(), test_defs::get<int>::capacity<2>(), TestStruct {});*/
return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(std::initializer_list<value_type> list)", []() constexpr {
("const_vector(std::initializer_list<value_type> list)", []() constexpr{
auto vi1 = CREATE_FROM_IL(cc::const_vector, test_defs::get<int>::i_list<1>, test_defs::get<int>::il_len<1>());
cc::const_vector vi1(test_defs::get<int>::i_list<1>); auto vi2 = CREATE_FROM_IL(cc::const_vector, test_defs::get<int>::i_list<2>, test_defs::get<int>::il_len<2>());
cc::const_vector vi2(test_defs::get<int>::i_list<2>);
cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi3(test_defs::get<int>::i_list<1>); cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi3(test_defs::get<int>::i_list<1>);
cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi4(test_defs::get<int>::i_list<2>); cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi4(test_defs::get<int>::i_list<2>);
@ -337,8 +334,7 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(InputIt first, InputIt last)", []() constexpr {
("const_vector(InputIt first, InputIt last)", []() constexpr{
cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi1(std::begin(test_defs::get<int>::arr<1>), std::end(test_defs::get<int>::arr<1>)); cc::const_vector<int, test_defs::get<int>::capacity<1>()> vi1(std::begin(test_defs::get<int>::arr<1>), std::end(test_defs::get<int>::arr<1>));
cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi2(std::begin(test_defs::get<int>::arr<2>), std::end(test_defs::get<int>::arr<2>)); cc::const_vector<int, test_defs::get<int>::capacity<2>()> vi2(std::begin(test_defs::get<int>::arr<2>), std::end(test_defs::get<int>::arr<2>));
@ -429,8 +425,7 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(const const_vector& other)", []() constexpr {
("const_vector(const const_vector& other)", []() constexpr{
cc::const_vector vi1(test_defs::get<int>::arr<1>); cc::const_vector vi1(test_defs::get<int>::arr<1>);
cc::const_vector vi2(test_defs::get<int>::arr<2>); cc::const_vector vi2(test_defs::get<int>::arr<2>);
@ -517,7 +512,6 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
("const_vector(const_vector&& other)", []() constexpr { ("const_vector(const_vector&& other)", []() constexpr {
cc::const_vector vi1(test_defs::get<int>::arr<1>); cc::const_vector vi1(test_defs::get<int>::arr<1>);
@ -582,7 +576,7 @@ constexpr test_suite tests = define_tests("Tests")
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL) }, EvalFlag::RUNTIME_CONSTEVAL)
/*("const_vector(const_vector&& other)", []() { /*("const_vector(const_vector&& other)", []() constexpr {
return TEST_PASS(); return TEST_PASS();
}, EvalFlag::RUNTIME_CONSTEVAL)*/ }, EvalFlag::RUNTIME_CONSTEVAL)*/