A modern, C++-native, test framework for unit-tests, TDD and BDD - using C++14, C++17 and later (C++11 support is in v2.x branch, and C++03 on the Catch1.x branch)
I've been trying to use TEMPLATE_TEST_CASE_SIG with variadic template parameters, just as mentioned in the documentation, but I've never been able to make it work. Suppose the following code:
2>D:\Tests.cpp(98,1): error C2668: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': ambiguous call to overloaded function
2>D:\Tests.cpp(98,1): message : could be '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::Nttp<int> `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper<int,>(void) noexcept'
2>D:\Tests.cpp(98,1): message : or '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::TypeList<int> `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper<int>(void) noexcept'
2>D:\Tests.cpp(98,1): message : while trying to match the argument list '()'
2>D:\Tests.cpp(98,1): error C2672: 'get_wrapper': no matching overloaded function found
2>D:\Tests.cpp(98,1): error C2974: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': invalid template argument for 'Cs', type expected
2>D:\Tests.cpp(98): message : see declaration of '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper'
2>D:\Tests.cpp(98,1): error C2974: '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper': invalid template argument for 'Ts', type expected
2>D:\Tests.cpp(98): message : see declaration of '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____16::get_wrapper'
Expected behavior
Once the compile issue resolved, expecting the test case to be called with T = int then again with T = int, Ts = true.
Reproduction steps
Try compiling the code snippet above.
Platform information:
OS: Windows 10 x64
Compiler+version: MSVC 16.11.2 (Visual Studio 2019)
Catch version: v2.13.7
Additional context
Am I understanding correctly what TEMPLATE_TEST_CASE_SIG with variadic template parameters is able to do? Also tried to call the macro this way:
Describe the bug
I've been trying to use
TEMPLATE_TEST_CASE_SIG
with variadic template parameters, just as mentioned in the documentation, but I've never been able to make it work. Suppose the following code:Compiler output the following error:
Expected behavior
Once the compile issue resolved, expecting the test case to be called with
T = int
then again withT = int, Ts = true
.Reproduction steps
Try compiling the code snippet above.
Platform information:
Additional context
Am I understanding correctly what
TEMPLATE_TEST_CASE_SIG
with variadic template parameters is able to do? Also tried to call the macro this way:...but it results in the same error.