mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-13 09:59:32 +01: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:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<testsuites>
|
||||
<testsuite name="<exe-name>" errors="17" failures="130" skipped="12" tests="2281" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<testsuite name="<exe-name>" errors="17" failures="134" skipped="12" tests="2285" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
|
||||
<properties>
|
||||
<property name="random-seed" value="1"/>
|
||||
<property name="filters" value=""*" ~[!nonportable] ~[!benchmark] ~[approvals]"/>
|
||||
@@ -1474,6 +1474,10 @@ at Misc.tests.cpp:<line number>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/resizing smaller changes size but not capacity/We can use the 'swap trick' to reset the capacity" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving bigger changes capacity but not size" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTest: vectors can be sized and resized - std::tuple<int,float>/reserving smaller does not change size or capacity" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: compiles with a single int parameter - 1" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: compiles with a single int parameter - 3" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: compiles with a single int parameter - 6" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: compiles with two type parameters - int,int" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing bigger changes size and capacity" time="{duration}" status="run"/>
|
||||
<testcase classname="<exe-name>.global" name="TemplateTestSig: vectors can be sized and resized - (std::tuple<int, float>), 6/resizing smaller changes size but not capacity" time="{duration}" status="run"/>
|
||||
|
||||
Reference in New Issue
Block a user