catch3
Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.
Clonegit clone https://git.progmasoft.com/catch3
Cleanup some tests
- Commit
c8d765a57508e687e117f9c4d32ec2d3c6a8a896- Author
- Martin Hořeňovský ·
- Parents
da783abee94d
Changes
.../SelfTest/Baselines/compact.sw.approved.txt | 24 ++-- .../SelfTest/Baselines/console.sw.approved.txt | 144 ++++++++++----------- projects/SelfTest/Baselines/junit.sw.approved.txt | 10 +- projects/SelfTest/Baselines/xml.sw.approved.txt | 136 +++++++++---------- .../SelfTest/UsageTests/ToStringWhich.tests.cpp | 15 +-- 5 files changed, 163 insertions(+), 166 deletions(-) diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index 5569efd6..f8b5b888 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -982,6 +982,14 @@ ToStringPair.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( pr ) = == "{ { "green", 55 } }" Tricky.tests.cpp:<line number>: failed: std::string( "first" ) == "second" for: "first" == "second" +ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)" +== +"op<<(streamable_range)" +ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" for: "stringmaker(streamable_range)" +== +"stringmaker(streamable_range)" +ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" +ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" for: "{ !!! }" == "{ !!! }" ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>" == "StringMaker<has_maker>" @@ -992,18 +1000,6 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(item) ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )" == "operator<<( has_operator )" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" -ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" for: "op<<(streamable_range)" -== -"op<<(streamable_range)" -ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" for: "stringmaker(streamable_range)" -== -"stringmaker(streamable_range)" -ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" -ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" for: "{ !!! }" == "{ !!! }" ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" for: "{ StringMaker<has_maker> }" == "{ StringMaker<has_maker> }" @@ -1013,6 +1009,10 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) = ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" for: "{ operator<<( has_operator ) }" == "{ operator<<( has_operator ) }" +Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" +Misc.tests.cpp:<line number>: passed: result == "/"wide load/"" for: ""wide load"" == ""wide load"" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e0) == "E2/V0" for: "E2/V0" == "E2/V0" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e1) == "E2/V1" for: "E2/V1" == "E2/V1" EnumToString.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(e3) == "Unknown enum value 10" for: "Unknown enum value 10" diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index c1f1161e..0bac931d 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -7862,6 +7862,40 @@ Tricky.tests.cpp:<line number>: FAILED: with expansion: "first" == "second" +------------------------------------------------------------------------------- +stringify ranges +------------------------------------------------------------------------------- +ToStringWhich.tests.cpp:<line number> +............................................................................... + +ToStringWhich.tests.cpp:<line number>: +PASSED: + REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" ) +with expansion: + "op<<(streamable_range)" + == + "op<<(streamable_range)" + +ToStringWhich.tests.cpp:<line number>: +PASSED: + REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" ) +with expansion: + "stringmaker(streamable_range)" + == + "stringmaker(streamable_range)" + +ToStringWhich.tests.cpp:<line number>: +PASSED: + REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" ) +with expansion: + "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" + +ToStringWhich.tests.cpp:<line number>: +PASSED: + REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" ) +with expansion: + "{ !!! }" == "{ !!! }" + ------------------------------------------------------------------------------- stringify( has_maker ) ------------------------------------------------------------------------------- @@ -7877,7 +7911,7 @@ with expansion: "StringMaker<has_maker>" ------------------------------------------------------------------------------- -stringify( has_maker_and_toString ) +stringify( has_maker_and_operator ) ------------------------------------------------------------------------------- ToStringWhich.tests.cpp:<line number> ............................................................................... @@ -7917,43 +7951,49 @@ with expansion: "operator<<( has_operator )" ------------------------------------------------------------------------------- -toString on const wchar_t const pointer returns the string contents +stringify( vectors<has_maker> ) ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringWhich.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: +ToStringWhich.tests.cpp:<line number>: PASSED: - CHECK( result == "\"wide load\"" ) + REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" ) with expansion: - ""wide load"" == ""wide load"" + "{ StringMaker<has_maker> }" + == + "{ StringMaker<has_maker> }" ------------------------------------------------------------------------------- -toString on const wchar_t pointer returns the string contents +stringify( vectors<has_maker_and_operator> ) ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringWhich.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: +ToStringWhich.tests.cpp:<line number>: PASSED: - CHECK( result == "\"wide load\"" ) + REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" ) with expansion: - ""wide load"" == ""wide load"" + "{ StringMaker<has_maker_and_operator> }" + == + "{ StringMaker<has_maker_and_operator> }" ------------------------------------------------------------------------------- -toString on wchar_t const pointer returns the string contents +stringify( vectors<has_operator> ) ------------------------------------------------------------------------------- -Misc.tests.cpp:<line number> +ToStringWhich.tests.cpp:<line number> ............................................................................... -Misc.tests.cpp:<line number>: +ToStringWhich.tests.cpp:<line number>: PASSED: - CHECK( result == "\"wide load\"" ) + REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" ) with expansion: - ""wide load"" == ""wide load"" + "{ operator<<( has_operator ) }" + == + "{ operator<<( has_operator ) }" ------------------------------------------------------------------------------- -toString on wchar_t returns the string contents +toString on const wchar_t const pointer returns the string contents ------------------------------------------------------------------------------- Misc.tests.cpp:<line number> ............................................................................... @@ -7965,80 +8005,40 @@ with expansion: ""wide load"" == ""wide load"" ------------------------------------------------------------------------------- -toString streamable range -------------------------------------------------------------------------------- -ToStringWhich.tests.cpp:<line number> -............................................................................... - -ToStringWhich.tests.cpp:<line number>: -PASSED: - REQUIRE( ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" ) -with expansion: - "op<<(streamable_range)" - == - "op<<(streamable_range)" - -ToStringWhich.tests.cpp:<line number>: -PASSED: - REQUIRE( ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" ) -with expansion: - "stringmaker(streamable_range)" - == - "stringmaker(streamable_range)" - -ToStringWhich.tests.cpp:<line number>: -PASSED: - REQUIRE( ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" ) -with expansion: - "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" - -ToStringWhich.tests.cpp:<line number>: -PASSED: - REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" ) -with expansion: - "{ !!! }" == "{ !!! }" - -------------------------------------------------------------------------------- -toString( vectors<has_maker> ) +toString on const wchar_t pointer returns the string contents ------------------------------------------------------------------------------- -ToStringWhich.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: +Misc.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" ) + CHECK( result == "\"wide load\"" ) with expansion: - "{ StringMaker<has_maker> }" - == - "{ StringMaker<has_maker> }" + ""wide load"" == ""wide load"" ------------------------------------------------------------------------------- -toString( vectors<has_maker_and_operator> ) +toString on wchar_t const pointer returns the string contents ------------------------------------------------------------------------------- -ToStringWhich.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: +Misc.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" ) + CHECK( result == "\"wide load\"" ) with expansion: - "{ StringMaker<has_maker_and_operator> }" - == - "{ StringMaker<has_maker_and_operator> }" + ""wide load"" == ""wide load"" ------------------------------------------------------------------------------- -toString( vectors<has_operator> ) +toString on wchar_t returns the string contents ------------------------------------------------------------------------------- -ToStringWhich.tests.cpp:<line number> +Misc.tests.cpp:<line number> ............................................................................... -ToStringWhich.tests.cpp:<line number>: +Misc.tests.cpp:<line number>: PASSED: - REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" ) + CHECK( result == "\"wide load\"" ) with expansion: - "{ operator<<( has_operator ) }" - == - "{ operator<<( has_operator ) }" + ""wide load"" == ""wide load"" ------------------------------------------------------------------------------- toString(enum class w/operator<<) diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index cbca0198..1931ee0e 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -820,18 +820,18 @@ Message.tests.cpp:<line number> Tricky.tests.cpp:<line number> </failure> </testcase> + <testcase classname="<exe-name>.global" name="stringify ranges" time="{duration}"/> <testcase classname="<exe-name>.global" name="stringify( has_maker )" time="{duration}"/> - <testcase classname="<exe-name>.global" name="stringify( has_maker_and_toString )" time="{duration}"/> + <testcase classname="<exe-name>.global" name="stringify( has_maker_and_operator )" time="{duration}"/> <testcase classname="<exe-name>.global" name="stringify( has_neither )" time="{duration}"/> <testcase classname="<exe-name>.global" name="stringify( has_operator )" time="{duration}"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_maker> )" time="{duration}"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_maker_and_operator> )" time="{duration}"/> + <testcase classname="<exe-name>.global" name="stringify( vectors<has_operator> )" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString on const wchar_t const pointer returns the string contents" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString on wchar_t returns the string contents" time="{duration}"/> - <testcase classname="<exe-name>.global" name="toString streamable range" time="{duration}"/> - <testcase classname="<exe-name>.global" name="toString( vectors<has_maker> )" time="{duration}"/> - <testcase classname="<exe-name>.global" name="toString( vectors<has_maker_and_operator> )" time="{duration}"/> - <testcase classname="<exe-name>.global" name="toString( vectors<has_operator> )" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString(enum class w/operator<<)" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString(enum class)" time="{duration}"/> <testcase classname="<exe-name>.global" name="toString(enum w/operator<<)" time="{duration}"/> diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index abfc0590..53c3937f 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -8729,174 +8729,174 @@ loose text artifact </Expression> <OverallResult success="false"/> </TestCase> - <TestCase name="stringify( has_maker )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <TestCase name="stringify ranges" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" + ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" </Original> <Expanded> - "StringMaker<has_maker>" + "op<<(streamable_range)" == -"StringMaker<has_maker>" +"op<<(streamable_range)" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_maker_and_toString )" tags="[.][toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" + ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" </Original> <Expanded> - "StringMaker<has_maker_and_operator>" + "stringmaker(streamable_range)" == -"StringMaker<has_maker_and_operator>" +"stringmaker(streamable_range)" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_neither )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify(item) == "{ !!! }" + ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" </Original> <Expanded> - "{ !!! }" == "{ !!! }" + "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" </Expanded> </Expression> - <OverallResult success="true"/> - </TestCase> - <TestCase name="stringify( has_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" + ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" </Original> <Expanded> - "operator<<( has_operator )" -== -"operator<<( has_operator )" + "{ !!! }" == "{ !!! }" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="stringify( has_maker )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - result == "\"wide load\"" + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" </Original> <Expanded> - ""wide load"" == ""wide load"" + "StringMaker<has_maker>" +== +"StringMaker<has_maker>" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString on const wchar_t pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="stringify( has_maker_and_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - result == "\"wide load\"" + ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" </Original> <Expanded> - ""wide load"" == ""wide load"" + "StringMaker<has_maker_and_operator>" +== +"StringMaker<has_maker_and_operator>" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString on wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="stringify( has_neither )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - result == "\"wide load\"" + ::Catch::Detail::stringify(item) == "{ !!! }" </Original> <Expanded> - ""wide load"" == ""wide load"" + "{ !!! }" == "{ !!! }" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString on wchar_t returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > - <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <TestCase name="stringify( has_operator )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - result == "\"wide load\"" + ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" </Original> <Expanded> - ""wide load"" == ""wide load"" + "operator<<( has_operator )" +== +"operator<<( has_operator )" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString streamable range" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <TestCase name="stringify( vectors<has_maker> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)" + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" </Original> <Expanded> - "op<<(streamable_range)" + "{ StringMaker<has_maker> }" == -"op<<(streamable_range)" +"{ StringMaker<has_maker> }" </Expanded> </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_maker_and_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)" + ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" </Original> <Expanded> - "stringmaker(streamable_range)" + "{ StringMaker<has_maker_and_operator> }" == -"stringmaker(streamable_range)" +"{ StringMaker<has_maker_and_operator> }" </Expanded> </Expression> + <OverallResult success="true"/> + </TestCase> + <TestCase name="stringify( vectors<has_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > <Original> - ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" + ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" </Original> <Expanded> - "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" + "{ operator<<( has_operator ) }" +== +"{ operator<<( has_operator ) }" </Expanded> </Expression> - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <OverallResult success="true"/> + </TestCase> + <TestCase name="toString on const wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" + result == "\"wide load\"" </Original> <Expanded> - "{ !!! }" == "{ !!! }" + ""wide load"" == ""wide load"" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString( vectors<has_maker> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <TestCase name="toString on const wchar_t pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" + result == "\"wide load\"" </Original> <Expanded> - "{ StringMaker<has_maker> }" -== -"{ StringMaker<has_maker> }" + ""wide load"" == ""wide load"" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString( vectors<has_maker_and_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <TestCase name="toString on wchar_t const pointer returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" + result == "\"wide load\"" </Original> <Expanded> - "{ StringMaker<has_maker_and_operator> }" -== -"{ StringMaker<has_maker_and_operator> }" + ""wide load"" == ""wide load"" </Expanded> </Expression> <OverallResult success="true"/> </TestCase> - <TestCase name="toString( vectors<has_operator> )" tags="[toString]" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > - <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > + <TestCase name="toString on wchar_t returns the string contents" tags="[toString]" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > + <Expression success="true" type="CHECK" filename="projects/<exe-name>/UsageTests/Misc.tests.cpp" > <Original> - ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" + result == "\"wide load\"" </Original> <Expanded> - "{ operator<<( has_operator ) }" -== -"{ operator<<( has_operator ) }" + ""wide load"" == ""wide load"" </Expanded> </Expression> <OverallResult success="true"/> diff --git a/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp b/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp index eb1e53e5..7be99dcd 100644 --- a/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp +++ b/projects/SelfTest/UsageTests/ToStringWhich.tests.cpp @@ -59,7 +59,7 @@ TEST_CASE( "stringify( has_maker )", "[toString]" ) { } // Call the stringmaker -TEST_CASE( "stringify( has_maker_and_toString )", "[.][toString]" ) { +TEST_CASE( "stringify( has_maker_and_operator )", "[toString]" ) { has_maker_and_operator item; REQUIRE( ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" ); } @@ -72,25 +72,22 @@ TEST_CASE("stringify( has_neither )", "[toString]") { // Vectors... -// Don't run this in approval tests as it is sensitive to two phase lookup differences -TEST_CASE( "toString( vectors<has_operator> )", "[toString]" ) { +TEST_CASE( "stringify( vectors<has_operator> )", "[toString]" ) { std::vector<has_operator> v(1); REQUIRE( ::Catch::Detail::stringify( v ) == "{ operator<<( has_operator ) }" ); } -TEST_CASE( "toString( vectors<has_maker> )", "[toString]" ) { +TEST_CASE( "stringify( vectors<has_maker> )", "[toString]" ) { std::vector<has_maker> v(1); REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker> }" ); } -// Don't run this in approval tests as it is sensitive to two phase lookup differences -TEST_CASE( "toString( vectors<has_maker_and_operator> )", "[toString]" ) { +TEST_CASE( "stringify( vectors<has_maker_and_operator> )", "[toString]" ) { std::vector<has_maker_and_operator> v(1); REQUIRE( ::Catch::Detail::stringify( v ) == "{ StringMaker<has_maker_and_operator> }" ); } -// Conversion should go -// StringMaker specialization, operator<<, range/enum detection, unprintable +// Range-based conversion should only be used if other possibilities fail struct int_iterator { using iterator_category = std::input_iterator_tag; using difference_type = std::ptrdiff_t; @@ -155,7 +152,7 @@ struct is_range<disabled_range> { }; } -TEST_CASE("toString streamable range", "[toString]") { +TEST_CASE("stringify ranges", "[toString]") { REQUIRE(::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)"); REQUIRE(::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)"); REQUIRE(::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }");