#ifndef UDIFF_TEST_ARGS_H_ #define UDIFF_TEST_ARGS_H_ #include #include #include "test/common_helper/test_util.h" struct test_defs { #define GEN_TEST_STRUCT_ARR(nr, i) TestStruct(C_VI_TEST_ARR##nr[i], C_VC_TEST_ARR##nr[i], C_VS_TEST_ARR##nr[i]) #define TEST_VEC1_CAPACITY 5 #define TEST_VEC2_CAPACITY 10 #define TEST_VEC1_SIZE 3 #define TEST_VEC2_SIZE 7 #define VI_TEST_VAL 5 #define VC_TEST_VAL 'T' #define VS_TEST_VAL "Test string" #define VO_TEST_VAL TestStruct(VI_TEST_VAL, VC_TEST_VAL, VS_TEST_VAL) #define VI_TEST_ARR1 { 1, 2, 3, 4 } #define VI_TEST_ARR2 { 5, 6, 7, 8, 9, 10, 11, 12 } #define VC_TEST_ARR1 { 'a', 'B', 'c', 'D' } #define VC_TEST_ARR2 { 'e', 'F', 'g', 'H', 'i', 'J', '\n', '\0' } #define VS_TEST_ARR1 { "Lorem", "ipsum", "dolor", "sit" } #define VS_TEST_ARR2 { "amet", "consetetur", "sadipscing", "elitr", "sed", "diam", "nonumy", "eirmod", "tempor", "\0" } #define VO_TEST_ARR1 { GEN_TEST_STRUCT_ARR(1, 0), \ GEN_TEST_STRUCT_ARR(1, 1), \ GEN_TEST_STRUCT_ARR(1, 2), \ GEN_TEST_STRUCT_ARR(1, 3) } #define VO_TEST_ARR2 { GEN_TEST_STRUCT_ARR(2, 0), \ GEN_TEST_STRUCT_ARR(2, 1), \ GEN_TEST_STRUCT_ARR(2, 2), \ GEN_TEST_STRUCT_ARR(2, 3), \ GEN_TEST_STRUCT_ARR(2, 4), \ GEN_TEST_STRUCT_ARR(2, 5), \ GEN_TEST_STRUCT_ARR(2, 6), \ GEN_TEST_STRUCT_ARR(2, 7) } static constexpr std::initializer_list VI_I_LIST1 = VI_TEST_ARR1; static constexpr std::initializer_list VI_I_LIST2 = VI_TEST_ARR2; static constexpr const int C_VI_TEST_ARR1[] = VI_TEST_ARR1; static constexpr const int C_VI_TEST_ARR2[] = VI_TEST_ARR2; static constexpr const std::array STD_VI_TEST_ARR1 = VI_TEST_ARR1; static constexpr const std::array STD_VI_TEST_ARR2 = VI_TEST_ARR2; static constexpr const std::size_t VI_TEST_ARR1_LEN = C_ARR_LEN(C_VI_TEST_ARR1); static constexpr const std::size_t VI_TEST_ARR2_LEN = C_ARR_LEN(C_VI_TEST_ARR2); static constexpr std::initializer_list VC_I_LIST1 = VC_TEST_ARR1; static constexpr std::initializer_list VC_I_LIST2 = VC_TEST_ARR2; static constexpr const char C_VC_TEST_ARR1[] = VC_TEST_ARR1; static constexpr const char C_VC_TEST_ARR2[] = VC_TEST_ARR2; static constexpr const std::array STD_VC_TEST_ARR1 = VC_TEST_ARR1; static constexpr const std::array STD_VC_TEST_ARR2 = VC_TEST_ARR2; static constexpr const std::size_t VC_TEST_ARR1_LEN = C_ARR_LEN(C_VC_TEST_ARR1); static constexpr const std::size_t VC_TEST_ARR2_LEN = C_ARR_LEN(C_VC_TEST_ARR2); static constexpr std::initializer_list VS_I_LIST1 = VS_TEST_ARR1; static constexpr std::initializer_list VS_I_LIST2 = VS_TEST_ARR2; static constexpr const char * C_VS_TEST_ARR1[] = VS_TEST_ARR1; static constexpr const char * C_VS_TEST_ARR2[] = VS_TEST_ARR2; static constexpr const std::array STD_VS_TEST_ARR1 = VS_TEST_ARR1; static constexpr const std::array STD_VS_TEST_ARR2 = VS_TEST_ARR2; static constexpr const std::size_t VS_TEST_ARR1_LEN = C_ARR_LEN(C_VS_TEST_ARR1); static constexpr const std::size_t VS_TEST_ARR2_LEN = C_ARR_LEN(C_VS_TEST_ARR2); static constexpr TestStruct C_VO_TEST_ARR1[] = VO_TEST_ARR1; static constexpr TestStruct C_VO_TEST_ARR2[] = VO_TEST_ARR2; static constexpr const std::array STD_VO_TEST_ARR1 = VO_TEST_ARR1; static constexpr const std::array STD_VO_TEST_ARR2 = VO_TEST_ARR2; static constexpr const std::size_t VO_TEST_ARR1_LEN = C_ARR_LEN(C_VO_TEST_ARR1); static constexpr const std::size_t VO_TEST_ARR2_LEN = C_ARR_LEN(C_VO_TEST_ARR2); static constexpr std::initializer_list VO_I_LIST1 = VO_TEST_ARR1; static constexpr std::initializer_list VO_I_LIST2 = VO_TEST_ARR2; template struct get { template static consteval auto& i_list(); template static consteval auto & arr(); template static consteval std::size_t arr_len(); template static consteval std::size_t capacity(); }; }; template template consteval auto & test_defs::get::i_list() { return nullptr; } template template consteval auto & test_defs::get::arr() { return nullptr; } template template consteval std::size_t test_defs::get::arr_len() { return 0; } template template consteval std::size_t test_defs::get::capacity() { return 0; } template<> template<> consteval auto & test_defs::get::i_list<1>() { return VI_I_LIST1; } template<> template<> consteval auto & test_defs::get::i_list<2>() { return VI_I_LIST2; } template<> template<> consteval auto & test_defs::get::i_list<1>() { return VC_I_LIST1; } template<> template<> consteval auto & test_defs::get::i_list<2>() { return VC_I_LIST2; } template<> template<> consteval auto & test_defs::get::i_list<1>() { return VS_I_LIST1; } template<> template<> consteval auto & test_defs::get::i_list<2>() { return VS_I_LIST2; } template<> template<> consteval auto & test_defs::get::i_list<1>() { return VO_I_LIST1; } template<> template<> consteval auto & test_defs::get::i_list<2>() { return VO_I_LIST2; } template<> template<> consteval auto & test_defs::get::arr<1>() { return C_VI_TEST_ARR1; } template<> template<> consteval auto & test_defs::get::arr<2>() { return C_VI_TEST_ARR2; } template<> template<> consteval auto & test_defs::get::arr<1>() { return C_VC_TEST_ARR1; } template<> template<> consteval auto & test_defs::get::arr<2>() { return C_VC_TEST_ARR2; } template<> template<> consteval auto & test_defs::get::arr<1>() { return C_VS_TEST_ARR1; } template<> template<> consteval auto & test_defs::get::arr<2>() { return C_VS_TEST_ARR2; } template<> template<> consteval auto & test_defs::get::arr<1>() { return C_VO_TEST_ARR1; } template<> template<> consteval auto & test_defs::get::arr<2>() { return C_VO_TEST_ARR2; } template<> template<> consteval std::size_t test_defs::get::arr_len<1>() { return VI_TEST_ARR1_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<2>() { return VI_TEST_ARR2_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<1>() { return VC_TEST_ARR1_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<2>() { return VC_TEST_ARR2_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<1>() { return VS_TEST_ARR1_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<2>() { return VS_TEST_ARR2_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<1>() { return VO_TEST_ARR1_LEN; } template<> template<> consteval std::size_t test_defs::get::arr_len<2>() { return VO_TEST_ARR2_LEN; } template<> template<> consteval std::size_t test_defs::get::capacity<1>() { return TEST_VEC1_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<2>() { return TEST_VEC2_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<1>() { return TEST_VEC1_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<2>() { return TEST_VEC2_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<1>() { return TEST_VEC1_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<2>() { return TEST_VEC2_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<1>() { return TEST_VEC1_CAPACITY; } template<> template<> consteval std::size_t test_defs::get::capacity<2>() { return TEST_VEC2_CAPACITY; } #endif //UDIFF_TEST_ARGS_H_