Enabled SFINAE stream test

This commit is contained in:
Phil Nash 2017-04-25 14:57:58 +01:00
parent 569d355b36
commit 61ac34045c
6 changed files with 62 additions and 11 deletions

View File

@ -940,6 +940,6 @@ with expansion:
"first" == "second"
===============================================================================
test cases: 167 | 119 passed | 44 failed | 4 failed as expected
assertions: 967 | 859 passed | 87 failed | 21 failed as expected
test cases: 168 | 120 passed | 44 failed | 4 failed as expected
assertions: 968 | 860 passed | 87 failed | 21 failed as expected

View File

@ -123,6 +123,20 @@ PASSED:
with expansion:
1 == 1
-------------------------------------------------------------------------------
#872
-------------------------------------------------------------------------------
CompilationTests.cpp:<line number>
...............................................................................
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE( x == 4 )
with expansion:
{?} == 4
with message:
dummy := 0
-------------------------------------------------------------------------------
'Not' checks that should fail
-------------------------------------------------------------------------------
@ -9466,6 +9480,6 @@ MiscTests.cpp:<line number>:
PASSED:
===============================================================================
test cases: 167 | 118 passed | 45 failed | 4 failed as expected
assertions: 969 | 859 passed | 89 failed | 21 failed as expected
test cases: 168 | 119 passed | 45 failed | 4 failed as expected
assertions: 970 | 860 passed | 89 failed | 21 failed as expected

View File

@ -123,6 +123,20 @@ PASSED:
with expansion:
1 == 1
-------------------------------------------------------------------------------
#872
-------------------------------------------------------------------------------
CompilationTests.cpp:<line number>
...............................................................................
CompilationTests.cpp:<line number>:
PASSED:
REQUIRE( x == 4 )
with expansion:
{?} == 4
with message:
dummy := 0
-------------------------------------------------------------------------------
'Not' checks that should fail
-------------------------------------------------------------------------------
@ -144,6 +158,6 @@ ConditionTests.cpp:<line number>: FAILED:
CHECK_FALSE( true )
===============================================================================
test cases: 6 | 3 passed | 1 failed | 2 failed as expected
assertions: 18 | 11 passed | 4 failed | 3 failed as expected
test cases: 7 | 4 passed | 1 failed | 2 failed as expected
assertions: 19 | 12 passed | 4 failed | 3 failed as expected

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesspanner>
<testsuite name="<exe-name>" errors="13" failures="77" tests="970" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="13" failures="77" tests="971" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testcase classname="global" name="# A test name that starts with a #" time="{duration}"/>
<testcase classname="#748 - captures with unexpected exceptions" name="outside assertions" time="{duration}">
<error type="TEST_CASE">
@ -24,6 +24,7 @@ ExceptionTests.cpp:<line number>
MiscTests.cpp:<line number>
</failure>
</testcase>
<testcase classname="global" name="#872" time="{duration}"/>
<testcase classname="global" name="'Not' checks that should fail" time="{duration}">
<failure message="false != false" type="CHECK">
ConditionTests.cpp:<line number>

View File

@ -136,6 +136,20 @@
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="#872" filename="projects/<exe-name>/CompilationTests.cpp" >
<Info>
dummy := 0
</Info>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/CompilationTests.cpp" >
<Original>
x == 4
</Original>
<Expanded>
{?} == 4
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="'Not' checks that should fail" tags="[.][failing][hide]" filename="projects/<exe-name>/ConditionTests.cpp" >
<Expression success="false" type="CHECK" filename="projects/<exe-name>/ConditionTests.cpp" >
<Original>
@ -10114,7 +10128,7 @@ spanner <OverallResult success="true"/>
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="859" failures="90" expectedFailures="21"/>
<OverallResults successes="860" failures="90" expectedFailures="21"/>
</Group>
<OverallResults successes="859" failures="89" expectedFailures="21"/>
<OverallResults successes="860" failures="89" expectedFailures="21"/>
</Catch>

View File

@ -51,8 +51,12 @@ TEST_CASE("#833") {
REQUIRE(templated_tests<int>(3));
}
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
#endif
// Test containing example where original stream insertable check breaks compilation
#if defined (CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK)
namespace {
struct A {};
std::ostream& operator<< (std::ostream &o, const A &) { return o << 0; }
@ -64,9 +68,13 @@ namespace {
B f ();
std::ostream g ();
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
TEST_CASE( "#872" ) {
A dummy;
CAPTURE( dummy );
B x;
REQUIRE (x == 4);
}
#endif