mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 13:55:39 +02:00
Allow using only types in TEMPLATE_TEST_CASE_SIG
. (#2995)
Right now `TEMPLATE_TEST_CASE_SIG` fails to compile when the signature contains only types: ``` TEMPLATE_TEST_CASE_SIG( "TemplateTestSig: compiles with two type parameters", "[template][onlytypes]", ((typename U, typename V), U, V), (int,int)) {} ``` The trick is to resolve the ambiguity between the two overloads of `get_wrapper` (`TypeList` and `Nttp`) by making one match more strongly. We also need to allow `reg_test` to register more than one type. Add unit tests. Fixes #2680 --------- Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
This commit is contained in:
@@ -12519,6 +12519,42 @@ Misc.tests.cpp:<line number>: PASSED:
|
||||
with expansion:
|
||||
5 >= 5
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
TemplateTestSig: compiles with a single int parameter - 1
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
|
||||
No assertions in test case 'TemplateTestSig: compiles with a single int parameter - 1'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
TemplateTestSig: compiles with a single int parameter - 3
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
|
||||
No assertions in test case 'TemplateTestSig: compiles with a single int parameter - 3'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
TemplateTestSig: compiles with a single int parameter - 6
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
|
||||
No assertions in test case 'TemplateTestSig: compiles with a single int parameter - 6'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
TemplateTestSig: compiles with two type parameters - int,int
|
||||
-------------------------------------------------------------------------------
|
||||
Misc.tests.cpp:<line number>
|
||||
...............................................................................
|
||||
|
||||
|
||||
No assertions in test case 'TemplateTestSig: compiles with two type parameters - int,int'
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6
|
||||
-------------------------------------------------------------------------------
|
||||
@@ -19001,6 +19037,6 @@ Misc.tests.cpp:<line number>
|
||||
Misc.tests.cpp:<line number>: PASSED:
|
||||
|
||||
===============================================================================
|
||||
test cases: 419 | 313 passed | 86 failed | 6 skipped | 14 failed as expected
|
||||
assertions: 2269 | 2087 passed | 147 failed | 35 failed as expected
|
||||
test cases: 423 | 313 passed | 90 failed | 6 skipped | 14 failed as expected
|
||||
assertions: 2273 | 2087 passed | 151 failed | 35 failed as expected
|
||||
|
||||
|
Reference in New Issue
Block a user