diff --git a/include/internal/catch_test_registry.h b/include/internal/catch_test_registry.h index f013e66a..97fe8d68 100644 --- a/include/internal/catch_test_registry.h +++ b/include/internal/catch_test_registry.h @@ -247,7 +247,7 @@ struct AutoReg : NonCopyable { } \ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ - using TestInit = decltype(convert(TmplList {})); \ + using TestInit = decltype(convert(std::declval())); \ TestInit t; \ t.reg_tests(); \ return 0; \ @@ -374,7 +374,7 @@ struct AutoReg : NonCopyable { }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ - using TestInit = decltype(convert(TmplList {}));\ + using TestInit = decltype(convert(std::declval()));\ TestInit t;\ t.reg_tests();\ return 0;\ diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index ebf3560a..b2edd620 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -1084,6 +1084,9 @@ Tag.tests.cpp:: passed: registry.add( "[@no square bracket at end", Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1 == 1 Class.tests.cpp:: passed: Template_Fixture::m_a == 1 for: 1.0 == 1 +Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 +Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 +Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 1 > 0 Misc.tests.cpp:: passed: sizeof(TestType) > 0 for: 4 > 0 diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 0f859df3..917ff6ff 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1380,6 +1380,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 295 | 221 passed | 70 failed | 4 failed as expected -assertions: 1550 | 1398 passed | 131 failed | 21 failed as expected +test cases: 298 | 224 passed | 70 failed | 4 failed as expected +assertions: 1553 | 1401 passed | 131 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index a14034f7..dfc9f0ba 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -8022,6 +8022,42 @@ Class.tests.cpp:: PASSED: with expansion: 1.0 == 1 +------------------------------------------------------------------------------- +Template test case with test types specified inside non-default-constructible +std::tuple - MyNonDefaultConstructibleTypes - 0 +------------------------------------------------------------------------------- +Misc.tests.cpp: +............................................................................... + +Misc.tests.cpp:: PASSED: + REQUIRE( sizeof(TestType) > 0 ) +with expansion: + 1 > 0 + +------------------------------------------------------------------------------- +Template test case with test types specified inside non-default-constructible +std::tuple - MyNonDefaultConstructibleTypes - 1 +------------------------------------------------------------------------------- +Misc.tests.cpp: +............................................................................... + +Misc.tests.cpp:: PASSED: + REQUIRE( sizeof(TestType) > 0 ) +with expansion: + 1 > 0 + +------------------------------------------------------------------------------- +Template test case with test types specified inside non-default-constructible +std::tuple - MyNonDefaultConstructibleTypes - 2 +------------------------------------------------------------------------------- +Misc.tests.cpp: +............................................................................... + +Misc.tests.cpp:: PASSED: + REQUIRE( sizeof(TestType) > 0 ) +with expansion: + 4 > 0 + ------------------------------------------------------------------------------- Template test case with test types specified inside std::tuple - MyTypes - 0 ------------------------------------------------------------------------------- @@ -12373,6 +12409,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 295 | 205 passed | 86 failed | 4 failed as expected -assertions: 1567 | 1398 passed | 148 failed | 21 failed as expected +test cases: 298 | 208 passed | 86 failed | 4 failed as expected +assertions: 1570 | 1401 passed | 148 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index abfb0a99..77a1926d 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -750,6 +750,9 @@ Misc.tests.cpp: + + + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 57de31fb..7715a043 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -9895,6 +9895,39 @@ Message from section two + + + + sizeof(TestType) > 0 + + + 1 > 0 + + + + + + + + sizeof(TestType) > 0 + + + 1 > 0 + + + + + + + + sizeof(TestType) > 0 + + + 4 > 0 + + + + @@ -14734,7 +14767,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/UsageTests/Misc.tests.cpp b/projects/SelfTest/UsageTests/Misc.tests.cpp index 763c6194..00a897d2 100644 --- a/projects/SelfTest/UsageTests/Misc.tests.cpp +++ b/projects/SelfTest/UsageTests/Misc.tests.cpp @@ -371,6 +371,16 @@ TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside std REQUIRE(sizeof(TestType) > 0); } +struct NonDefaultConstructibleType { + NonDefaultConstructibleType() = delete; +}; + +using MyNonDefaultConstructibleTypes = std::tuple; +TEMPLATE_LIST_TEST_CASE("Template test case with test types specified inside non-default-constructible std::tuple", "[template][list]", MyNonDefaultConstructibleTypes) +{ + REQUIRE(sizeof(TestType) > 0); +} + // https://github.com/philsquared/Catch/issues/166 TEST_CASE("A couple of nested sections followed by a failure", "[failing][.]") { SECTION("Outer")