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" "first" == "second"
=============================================================================== ===============================================================================
test cases: 149 | 110 passed | 38 failed | 1 failed as expected test cases: 155 | 116 passed | 38 failed | 1 failed as expected
assertions: 753 | 661 passed | 79 failed | 13 failed as expected assertions: 761 | 669 passed | 79 failed | 13 failed as expected

View File

@ -7373,6 +7373,96 @@ PASSED:
with expansion: with expansion:
true == true 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 Tag alias can be registered against tag patterns
The same tag alias can only be registered once The same tag alias can only be registered once
@ -7816,6 +7906,6 @@ with expansion:
true true
=============================================================================== ===============================================================================
test cases: 149 | 94 passed | 54 failed | 1 failed as expected test cases: 155 | 100 passed | 54 failed | 1 failed as expected
assertions: 773 | 661 passed | 99 failed | 13 failed as expected assertions: 781 | 669 passed | 99 failed | 13 failed as expected

View File

@ -1,5 +1,5 @@
<testsuites> <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)" time="{duration}"/>
<testcase classname="global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/> <testcase classname="global" name="toString(enum w/operator&lt;&lt;)" time="{duration}"/>
<testcase classname="global" name="toString(enum class)" 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 tag" time="{duration}"/>
<testcase classname="Parse test names and tags" name="empty quoted name" 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="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="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="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}"/> <testcase classname="global" name="Anonymous test case 1" time="{duration}"/>

View File

@ -7656,6 +7656,94 @@ there&quot;
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </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"> <TestCase name="Tag alias can be registered against tag patterns">
<Section name="The same tag alias can only be registered once"> <Section name="The same tag alias can only be registered once">
<Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" > <Expression success="true" type="CHECK_THAT" filename="projects/SelfTest/TagAliasTests.cpp" >
@ -8086,7 +8174,7 @@ there&quot;
</Section> </Section>
<OverallResult success="true"/> <OverallResult success="true"/>
</TestCase> </TestCase>
<OverallResults successes="661" failures="99" expectedFailures="13"/> <OverallResults successes="669" failures="99" expectedFailures="13"/>
</Group> </Group>
<OverallResults successes="661" failures="99" expectedFailures="13"/> <OverallResults successes="669" failures="99" expectedFailures="13"/>
</Catch> </Catch>

View File

@ -16,6 +16,7 @@
266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266ECD73170F3C620030D735 /* BDDTests.cpp */; }; 266ECD74170F3C620030D735 /* BDDTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266ECD73170F3C620030D735 /* BDDTests.cpp */; };
26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26711C8D195D465C0033EDA2 /* TagAliasTests.cpp */; }; 26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26711C8D195D465C0033EDA2 /* TagAliasTests.cpp */; };
26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; }; 26847E5F16BBADB40043B9C1 /* catch_message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26847E5D16BBADB40043B9C1 /* catch_message.cpp */; };
2691574C1A532A280054F1ED /* ToStringTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2691574B1A532A280054F1ED /* ToStringTuple.cpp */; };
26948286179A9AB900ED166E /* SectionTrackerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26948284179A9AB900ED166E /* SectionTrackerTests.cpp */; }; 26948286179A9AB900ED166E /* SectionTrackerTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26948284179A9AB900ED166E /* SectionTrackerTests.cpp */; };
2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_text.cpp */; }; 2694A1FD16A0000E004816E3 /* catch_text.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694A1FB16A0000E004816E3 /* catch_text.cpp */; };
26E1B7D319213BC900812682 /* CmdLineTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E1B7D119213BC900812682 /* CmdLineTests.cpp */; }; 26E1B7D319213BC900812682 /* CmdLineTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E1B7D119213BC900812682 /* CmdLineTests.cpp */; };
@ -97,6 +98,7 @@
26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = "<group>"; }; 26847E5D16BBADB40043B9C1 /* catch_message.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = catch_message.cpp; path = ../../../SelfTest/SurrogateCpps/catch_message.cpp; sourceTree = "<group>"; };
268F47B018A93F7800D8C14F /* catch_clara.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_clara.h; sourceTree = "<group>"; }; 268F47B018A93F7800D8C14F /* catch_clara.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = catch_clara.h; sourceTree = "<group>"; };
2691574A1A4480C50054F1ED /* catch_reporter_teamcity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_teamcity.hpp; sourceTree = "<group>"; }; 2691574A1A4480C50054F1ED /* catch_reporter_teamcity.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = catch_reporter_teamcity.hpp; sourceTree = "<group>"; };
2691574B1A532A280054F1ED /* ToStringTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToStringTuple.cpp; path = ../../../SelfTest/ToStringTuple.cpp; sourceTree = "<group>"; };
26926E8318D7777D004E10F2 /* clara.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = clara.h; path = ../../../../include/external/clara.h; sourceTree = "<group>"; }; 26926E8318D7777D004E10F2 /* clara.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = clara.h; path = ../../../../include/external/clara.h; sourceTree = "<group>"; };
26926E8418D77809004E10F2 /* tbc_text_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tbc_text_format.h; path = ../../../../include/external/tbc_text_format.h; sourceTree = "<group>"; }; 26926E8418D77809004E10F2 /* tbc_text_format.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tbc_text_format.h; path = ../../../../include/external/tbc_text_format.h; sourceTree = "<group>"; };
26948284179A9AB900ED166E /* SectionTrackerTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionTrackerTests.cpp; path = ../../../SelfTest/SectionTrackerTests.cpp; sourceTree = "<group>"; }; 26948284179A9AB900ED166E /* SectionTrackerTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionTrackerTests.cpp; path = ../../../SelfTest/SectionTrackerTests.cpp; sourceTree = "<group>"; };
@ -256,6 +258,7 @@
4A6D0C40149B3DAB00DB3EAA /* Tests */ = { 4A6D0C40149B3DAB00DB3EAA /* Tests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
2691574B1A532A280054F1ED /* ToStringTuple.cpp */,
263F7A4819B6FE1E009474C2 /* ToStringPair.cpp */, 263F7A4819B6FE1E009474C2 /* ToStringPair.cpp */,
263F7A4919B6FE1E009474C2 /* ToStringVector.cpp */, 263F7A4919B6FE1E009474C2 /* ToStringVector.cpp */,
263F7A4A19B6FE1E009474C2 /* ToStringWhich.cpp */, 263F7A4A19B6FE1E009474C2 /* ToStringWhich.cpp */,
@ -558,6 +561,7 @@
4A45DA2D16161FA2004F8D6B /* catch_interfaces_capture.cpp in Sources */, 4A45DA2D16161FA2004F8D6B /* catch_interfaces_capture.cpp in Sources */,
4A45DA3116161FFC004F8D6B /* catch_interfaces_reporter.cpp in Sources */, 4A45DA3116161FFC004F8D6B /* catch_interfaces_reporter.cpp in Sources */,
4A45DA3316162047004F8D6B /* catch_interfaces_exception.cpp in Sources */, 4A45DA3316162047004F8D6B /* catch_interfaces_exception.cpp in Sources */,
2691574C1A532A280054F1ED /* ToStringTuple.cpp in Sources */,
26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */, 26711C8F195D465C0033EDA2 /* TagAliasTests.cpp in Sources */,
4A45DA3516162071004F8D6B /* catch_interfaces_runner.cpp in Sources */, 4A45DA3516162071004F8D6B /* catch_interfaces_runner.cpp in Sources */,
4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */, 4AB3D99D1616216500C9A0F8 /* catch_interfaces_testcase.cpp in Sources */,