Added tests for toString<std::tuple<>> and rebased

This commit is contained in:
Phil Nash
2014-12-30 18:47:01 +00:00
parent e8a99231b6
commit 50183208a3
5 changed files with 195 additions and 7 deletions

View File

@@ -786,6 +786,6 @@ with expansion:
"first" == "second"
===============================================================================
test cases: 149 | 110 passed | 38 failed | 1 failed as expected
assertions: 753 | 661 passed | 79 failed | 13 failed as expected
test cases: 155 | 116 passed | 38 failed | 1 failed as expected
assertions: 761 | 669 passed | 79 failed | 13 failed as expected

View File

@@ -7373,6 +7373,96 @@ PASSED:
with expansion:
true == true
-------------------------------------------------------------------------------
tuple<>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ }" == Catch::toString(type{}) )
with expansion:
"{ }" == "{ }"
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ }" == Catch::toString(value) )
with expansion:
"{ }" == "{ }"
-------------------------------------------------------------------------------
tuple<int>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ 0 }" == Catch::toString(type{0}) )
with expansion:
"{ 0 }" == "{ 0 }"
-------------------------------------------------------------------------------
tuple<float,int>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "1.2f" == Catch::toString(float(1.2)) )
with expansion:
"1.2f" == "1.2f"
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ 1.2f, 0 }" == Catch::toString(type{1.2,0}) )
with expansion:
"{ 1.2f, 0 }" == "{ 1.2f, 0 }"
-------------------------------------------------------------------------------
tuple<string,string>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ \"hello\", \"world\" }" == Catch::toString(type{"hello","world"}) )
with expansion:
"{ "hello", "world" }"
==
"{ "hello", "world" }"
-------------------------------------------------------------------------------
tuple<tuple<int>,tuple<>,float>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ { 42 }, { }, 1.2f }" == Catch::toString(value) )
with expansion:
"{ { 42 }, { }, 1.2f }"
==
"{ { 42 }, { }, 1.2f }"
-------------------------------------------------------------------------------
tuple<nullptr,int,const char *>
-------------------------------------------------------------------------------
ToStringTuple.cpp:<line number>
...............................................................................
ToStringTuple.cpp:<line number>:
PASSED:
CHECK( "{ nullptr, 42, \"Catch me\" }" == Catch::toString(value) )
with expansion:
"{ nullptr, 42, "Catch me" }"
==
"{ nullptr, 42, "Catch me" }"
-------------------------------------------------------------------------------
Tag alias can be registered against tag patterns
The same tag alias can only be registered once
@@ -7816,6 +7906,6 @@ with expansion:
true
===============================================================================
test cases: 149 | 94 passed | 54 failed | 1 failed as expected
assertions: 773 | 661 passed | 99 failed | 13 failed as expected
test cases: 155 | 100 passed | 54 failed | 1 failed as expected
assertions: 781 | 669 passed | 99 failed | 13 failed as expected

View File

@@ -1,5 +1,5 @@
<testsuites>
<testsuite name="all tests" errors="12" failures="87" tests="773" hostname="tbd" time="{duration}" timestamp="tbd">
<testsuite name="all tests" errors="12" failures="87" tests="781" hostname="tbd" time="{duration}" timestamp="tbd">
<testcase classname="global" name="toString(enum)" time="{duration}"/>
<testcase classname="global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/>
<testcase classname="global" name="toString(enum class)" time="{duration}"/>
@@ -585,6 +585,12 @@ TrickyTests.cpp:<line number>
<testcase classname="Parse test names and tags" name="empty tag" time="{duration}"/>
<testcase classname="Parse test names and tags" name="empty quoted name" time="{duration}"/>
<testcase classname="Parse test names and tags" name="quoted string followed by tag exclusion" time="{duration}"/>
<testcase classname="global" name="tuple&lt;>" time="{duration}"/>
<testcase classname="global" name="tuple&lt;int>" time="{duration}"/>
<testcase classname="global" name="tuple&lt;float,int>" time="{duration}"/>
<testcase classname="global" name="tuple&lt;string,string>" time="{duration}"/>
<testcase classname="global" name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>" time="{duration}"/>
<testcase classname="global" name="tuple&lt;nullptr,int,const char *>" time="{duration}"/>
<testcase classname="Tag alias can be registered against tag patterns" name="The same tag alias can only be registered once" time="{duration}"/>
<testcase classname="Tag alias can be registered against tag patterns" name="Tag aliases must be of the form [@name]" time="{duration}"/>
<testcase classname="global" name="Anonymous test case 1" time="{duration}"/>

View File

@@ -7656,6 +7656,94 @@ there&quot;
</Section>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ }&quot; == Catch::toString(type{})
</Original>
<Expanded>
&quot;{ }&quot; == &quot;{ }&quot;
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ }&quot; == Catch::toString(value)
</Original>
<Expanded>
&quot;{ }&quot; == &quot;{ }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;int>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ 0 }&quot; == Catch::toString(type{0})
</Original>
<Expanded>
&quot;{ 0 }&quot; == &quot;{ 0 }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;float,int>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;1.2f&quot; == Catch::toString(float(1.2))
</Original>
<Expanded>
&quot;1.2f&quot; == &quot;1.2f&quot;
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ 1.2f, 0 }&quot; == Catch::toString(type{1.2,0})
</Original>
<Expanded>
&quot;{ 1.2f, 0 }&quot; == &quot;{ 1.2f, 0 }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;string,string>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ \&quot;hello\&quot;, \&quot;world\&quot; }&quot; == Catch::toString(type{&quot;hello&quot;,&quot;world&quot;})
</Original>
<Expanded>
&quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
==
&quot;{ &quot;hello&quot;, &quot;world&quot; }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;tuple&lt;int>,tuple&lt;>,float>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ { 42 }, { }, 1.2f }&quot; == Catch::toString(value)
</Original>
<Expanded>
&quot;{ { 42 }, { }, 1.2f }&quot;
==
&quot;{ { 42 }, { }, 1.2f }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="tuple&lt;nullptr,int,const char *>">
<Expression success="true" type="CHECK" filename="projects/SelfTest/ToStringTuple.cpp" >
<Original>
&quot;{ nullptr, 42, \&quot;Catch me\&quot; }&quot; == Catch::toString(value)
</Original>
<Expanded>
&quot;{ nullptr, 42, &quot;Catch me&quot; }&quot;
==
&quot;{ nullptr, 42, &quot;Catch me&quot; }&quot;
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Tag alias can be registered against tag patterns">
<Section name="The same tag alias can only be registered once">
<Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
@@ -8086,7 +8174,7 @@ there&quot;
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="661" failures="99" expectedFailures="13"/>
<OverallResults successes="669" failures="99" expectedFailures="13"/>
</Group>
<OverallResults successes="661" failures="99" expectedFailures="13"/>
<OverallResults successes="669" failures="99" expectedFailures="13"/>
</Catch>