diff options
| author | Phil Nash | 2014-12-30 18:24:31 +0000 |
|---|---|---|
| committer | Phil Nash | 2014-12-30 18:24:31 +0000 |
| commit | 6817bb099db44744cc32da193cbe710ffcead8b8 (patch) | |
| tree | 7763a90b53f3c10dd3af4525ce3da103c0c068e8 /projects | |
| parent | 3e0c5018123e7e32b3c35f4169cbdca4bcb8f332 (diff) | |
| download | catch3-6817bb099db44744cc32da193cbe710ffcead8b8.tar.gz | |
Fixed up xml reporter and rebased
Diffstat (limited to 'projects')
| -rw-r--r-- | projects/SelfTest/Baselines/console.std.approved.txt | 2 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/console.sw.approved.txt | 21 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/junit.sw.approved.txt | 3 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/xml.sw.approved.txt | 55 | ||||
| -rw-r--r-- | projects/SelfTest/TestMain.cpp | 5 |
5 files changed, 65 insertions, 21 deletions
diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 76e28c32..87319a67 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -787,5 +787,5 @@ with expansion: =============================================================================== test cases: 149 | 110 passed | 38 failed | 1 failed as expected -assertions: 751 | 659 passed | 79 failed | 13 failed as expected +assertions: 753 | 661 passed | 79 failed | 13 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index cf360ece..0c9a8ac9 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -4632,6 +4632,25 @@ PASSED: with expansion: "abcdefcg" == "abcdefcg" +------------------------------------------------------------------------------- +replaceInPlace + escape ' +------------------------------------------------------------------------------- +TestMain.cpp:<line number> +............................................................................... + +TestMain.cpp:<line number>: +PASSED: + CHECK( replaceInPlace( s, "'", "|'" ) ) +with expansion: + true + +TestMain.cpp:<line number>: +PASSED: + CHECK( s == "didn|'t" ) +with expansion: + "didn|'t" == "didn|'t" + hello hello ------------------------------------------------------------------------------- @@ -7798,5 +7817,5 @@ with expansion: =============================================================================== test cases: 149 | 94 passed | 54 failed | 1 failed as expected -assertions: 771 | 659 passed | 99 failed | 13 failed as expected +assertions: 773 | 661 passed | 99 failed | 13 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 8579d908..ba3f1799 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ <testsuites> - <testsuite name="all tests" errors="12" failures="87" tests="771" hostname="tbd" time="{duration}" timestamp="tbd"> + <testsuite name="all tests" errors="12" failures="87" tests="773" hostname="tbd" time="{duration}" timestamp="tbd"> <testcase classname="global" name="toString(enum)" time="{duration}"/> <testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/> <testcase classname="global" name="toString(enum class)" time="{duration}"/> @@ -491,6 +491,7 @@ MiscTests.cpp:<line number> <testcase classname="replaceInPlace" name="replace last char" time="{duration}"/> <testcase classname="replaceInPlace" name="replace all chars" time="{duration}"/> <testcase classname="replaceInPlace" name="replace no chars" time="{duration}"/> + <testcase classname="replaceInPlace" name="escape '" time="{duration}"/> <testcase classname="global" name="Strings can be rendered with colour" time="{duration}"> <system-out> hello diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 87c48b13..f05a2726 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -531,7 +531,7 @@ 1.3 == Approx( 1.301 ) </Expanded> </Expression> - <OverallResult success="false"/> + <OverallResult success="true"/> </TestCase> <TestCase name="Inequality checks that should succeed"> <Expression success="true" filename="projects/SelfTest/ConditionTests.cpp" > @@ -1541,7 +1541,7 @@ <OverallResult success="false"/> </TestCase> <TestCase name="When unchecked exceptions are thrown, but caught, they do not affect the test"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="Unexpected custom exceptions can be translated"> <Exception filename="projects/SelfTest/ExceptionTests.cpp" > @@ -2775,7 +2775,7 @@ <Warning> this is a warning </Warning> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="SUCCEED counts as a test pass"> <OverallResult success="true"/> @@ -2873,7 +2873,7 @@ <Section name="two"> <OverallResults successes="0" failures="1" expectedFailures="0"/> </Section> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="SCOPED_INFO is reset for each loop"> <Expression success="true" filename="projects/SelfTest/MessageTests.cpp" > @@ -2984,7 +2984,7 @@ <OverallResult success="false"/> </TestCase> <TestCase name="just info"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="just failure"> <Failure> @@ -3016,7 +3016,7 @@ <Warning> toString(p): 0x<hex digits> </Warning> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="random SECTION tests"> <Section name="s1" description="doesn't equal"> @@ -3117,7 +3117,7 @@ <Section name="f (leaf)"> <OverallResults successes="0" failures="1" expectedFailures="0"/> </Section> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="looped SECTION tests"> <Section name="s1" description="b is currently: 0"> @@ -3219,7 +3219,7 @@ <OverallResult success="false"/> </TestCase> <TestCase name="Sends stuff to stdout and stderr"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="null strings"> <Expression success="true" filename="projects/SelfTest/MiscTests.cpp" > @@ -3323,7 +3323,7 @@ <Section name="encoded chars" description="these should all be encoded: &&&"""<<<&"<<&""> <OverallResults successes="0" failures="1" expectedFailures="0"/> </Section> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="send a single char to INFO"> <Info> @@ -3525,19 +3525,19 @@ <OverallResult success="true"/> </TestCase> <TestCase name="An empty test with no assertions"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="Nice descriptive name"> <Warning> This one ran </Warning> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="first tag"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="second tag"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="vectors can be sized and resized"> <Expression success="true" filename="projects/SelfTest/MiscTests.cpp" > @@ -4829,10 +4829,29 @@ four" </Expression> <OverallResults successes="2" failures="0" expectedFailures="0"/> </Section> + <Section name="escape '"> + <Expression success="true" filename="projects/SelfTest/TestMain.cpp" > + <Original> + replaceInPlace( s, "'", "|'" ) + </Original> + <Expanded> + true + </Expanded> + </Expression> + <Expression success="true" filename="projects/SelfTest/TestMain.cpp" > + <Original> + s == "didn|'t" + </Original> + <Expanded> + "didn|'t" == "didn|'t" + </Expanded> + </Expression> + <OverallResults successes="2" failures="0" expectedFailures="0"/> + </Section> <OverallResult success="true"/> </TestCase> <TestCase name="Strings can be rendered with colour"> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="Text can be formatted using the Text class"> <Expression success="true" filename="projects/SelfTest/TestMain.cpp" > @@ -5883,13 +5902,13 @@ there" <Warning> Uncomment the code in this test to check that it gives a sensible compiler error </Warning> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="Where the LHS is not a simple value"> <Warning> Uncomment the code in this test to check that it gives a sensible compiler error </Warning> - <OverallResult success="true"/> + <OverallResult success="false"/> </TestCase> <TestCase name="A failing expression with a non streamable type is still captured"> <Expression success="false" filename="projects/SelfTest/TrickyTests.cpp" > @@ -8067,7 +8086,7 @@ there" </Section> <OverallResult success="true"/> </TestCase> - <OverallResults successes="659" failures="99" expectedFailures="13"/> + <OverallResults successes="661" failures="99" expectedFailures="13"/> </Group> - <OverallResults successes="659" failures="99" expectedFailures="13"/> + <OverallResults successes="661" failures="99" expectedFailures="13"/> </Catch> diff --git a/projects/SelfTest/TestMain.cpp b/projects/SelfTest/TestMain.cpp index 154a2994..4b60a4f5 100644 --- a/projects/SelfTest/TestMain.cpp +++ b/projects/SelfTest/TestMain.cpp @@ -374,6 +374,11 @@ TEST_CASE( "replaceInPlace", "" ) { CHECK_FALSE( replaceInPlace( letters, "x", "z" ) ); CHECK( letters == letters ); } + SECTION( "escape '" ) { + std::string s = "didn't"; + CHECK( replaceInPlace( s, "'", "|'" ) ); + CHECK( s == "didn|'t" ); + } } // !TBD: This will be folded into Text class |