diff --git a/projects/SelfTest/ApproxTests.cpp b/projects/SelfTest/ApproxTests.cpp index e4bc6ecd..bb6abffe 100644 --- a/projects/SelfTest/ApproxTests.cpp +++ b/projects/SelfTest/ApproxTests.cpp @@ -166,11 +166,7 @@ inline std::ostream& operator<<( std::ostream& os, StrongDoubleTypedef td ) { return os << "StrongDoubleTypedef(" << static_cast(td) << ")"; } -TEST_CASE -( - "Comparison with explicitly convertible types", - "[Approx][c++11]" -) +TEST_CASE( "Comparison with explicitly convertible types", "[Approx]" ) { StrongDoubleTypedef td(10.0); diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 7a4c8321..2b41e42a 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1001,7 +1001,23 @@ TrickyTests.cpp:: FAILED: with expansion: "first" == "second" -=============================================================================== -test cases: 173 | 123 passed | 46 failed | 4 failed as expected -assertions: 907 | 792 passed | 94 failed | 21 failed as expected +------------------------------------------------------------------------------- +toString(enum class) +------------------------------------------------------------------------------- +EnumToString.cpp: +............................................................................... + +EnumToString.cpp:: FAILED: + CHECK( ::Catch::Detail::stringify(e0) == "0" ) +with expansion: + "{?}" == "0" + +EnumToString.cpp:: FAILED: + CHECK( ::Catch::Detail::stringify(e1) == "1" ) +with expansion: + "{?}" == "1" + +=============================================================================== +test cases: 186 | 135 passed | 47 failed | 4 failed as expected +assertions: 939 | 822 passed | 96 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 17f5fc6a..0857fc24 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -923,6 +923,84 @@ with expansion: == 0x +------------------------------------------------------------------------------- +Comparison with explicitly convertible types +------------------------------------------------------------------------------- +ApproxTests.cpp: +............................................................................... + +ApproxTests.cpp:: +PASSED: + REQUIRE( td == Approx(10.0) ) +with expansion: + StrongDoubleTypedef(10) == Approx( 10.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(10.0) == td ) +with expansion: + Approx( 10.0 ) == StrongDoubleTypedef(10) + +ApproxTests.cpp:: +PASSED: + REQUIRE( td != Approx(11.0) ) +with expansion: + StrongDoubleTypedef(10) != Approx( 11.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(11.0) != td ) +with expansion: + Approx( 11.0 ) != StrongDoubleTypedef(10) + +ApproxTests.cpp:: +PASSED: + REQUIRE( td <= Approx(10.0) ) +with expansion: + StrongDoubleTypedef(10) <= Approx( 10.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( td <= Approx(11.0) ) +with expansion: + StrongDoubleTypedef(10) <= Approx( 11.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(10.0) <= td ) +with expansion: + Approx( 10.0 ) <= StrongDoubleTypedef(10) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(9.0) <= td ) +with expansion: + Approx( 9.0 ) <= StrongDoubleTypedef(10) + +ApproxTests.cpp:: +PASSED: + REQUIRE( td >= Approx(9.0) ) +with expansion: + StrongDoubleTypedef(10) >= Approx( 9.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( td >= Approx(10.0) ) +with expansion: + StrongDoubleTypedef(10) >= Approx( 10.0 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(10.0) >= td ) +with expansion: + Approx( 10.0 ) >= StrongDoubleTypedef(10) + +ApproxTests.cpp:: +PASSED: + REQUIRE( Approx(11.0) >= td ) +with expansion: + Approx( 11.0 ) >= StrongDoubleTypedef(10) + ------------------------------------------------------------------------------- Comparisons between ints where one side is computed ------------------------------------------------------------------------------- @@ -8059,6 +8137,20 @@ MessageTests.cpp:: FAILED: explicitly with message: Previous info should not be seen +------------------------------------------------------------------------------- +long long +------------------------------------------------------------------------------- +MiscTests.cpp: +............................................................................... + +MiscTests.cpp:: +PASSED: + REQUIRE( l == std::numeric_limits::max() ) +with expansion: + 9223372036854775807 (0x) + == + 9223372036854775807 (0x) + ------------------------------------------------------------------------------- looped SECTION tests s1 @@ -8248,6 +8340,18 @@ PASSED: with expansion: {null string} == {null string} +------------------------------------------------------------------------------- +null_ptr +------------------------------------------------------------------------------- +TrickyTests.cpp: +............................................................................... + +TrickyTests.cpp:: +PASSED: + REQUIRE( ptr.get() == 0 ) +with expansion: + 0 == 0 + ------------------------------------------------------------------------------- pair > -> toString ------------------------------------------------------------------------------- @@ -8615,6 +8719,48 @@ with expansion: == "{ StringMaker }" +------------------------------------------------------------------------------- +toString(enum class w/operator<<) +------------------------------------------------------------------------------- +EnumToString.cpp: +............................................................................... + +EnumToString.cpp:: +PASSED: + CHECK( ::Catch::Detail::stringify(e0) == "E2/V0" ) +with expansion: + "E2/V0" == "E2/V0" + +EnumToString.cpp:: +PASSED: + CHECK( ::Catch::Detail::stringify(e1) == "E2/V1" ) +with expansion: + "E2/V1" == "E2/V1" + +EnumToString.cpp:: +PASSED: + CHECK( ::Catch::Detail::stringify(e3) == "Unknown enum value 10" ) +with expansion: + "Unknown enum value 10" + == + "Unknown enum value 10" + +------------------------------------------------------------------------------- +toString(enum class) +------------------------------------------------------------------------------- +EnumToString.cpp: +............................................................................... + +EnumToString.cpp:: FAILED: + CHECK( ::Catch::Detail::stringify(e0) == "0" ) +with expansion: + "{?}" == "0" + +EnumToString.cpp:: FAILED: + CHECK( ::Catch::Detail::stringify(e1) == "1" ) +with expansion: + "{?}" == "1" + ------------------------------------------------------------------------------- toString(enum w/operator<<) ------------------------------------------------------------------------------- @@ -8651,6 +8797,140 @@ PASSED: with expansion: "1" == "1" +------------------------------------------------------------------------------- +tuple<> +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ }" == ::Catch::Detail::stringify(type{}) ) +with expansion: + "{ }" == "{ }" + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ }" == ::Catch::Detail::stringify(value) ) +with expansion: + "{ }" == "{ }" + +------------------------------------------------------------------------------- +tuple +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ) +with expansion: + "1.2f" == "1.2f" + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ) +with expansion: + "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + +------------------------------------------------------------------------------- +tuple +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) ) +with expansion: + "{ 0 }" == "{ 0 }" + +------------------------------------------------------------------------------- +tuple<0,int,const char *> +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) ) +with expansion: + "{ 0, 42, "Catch me" }" + == + "{ 0, 42, "Catch me" }" + +------------------------------------------------------------------------------- +tuple +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) ) +with expansion: + "{ "hello", "world" }" + == + "{ "hello", "world" }" + +------------------------------------------------------------------------------- +tuple,tuple<>,float> +------------------------------------------------------------------------------- +ToStringTuple.cpp: +............................................................................... + +ToStringTuple.cpp:: +PASSED: + CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ) +with expansion: + "{ { 42 }, { }, 1.2f }" + == + "{ { 42 }, { }, 1.2f }" + +------------------------------------------------------------------------------- +vec> -> toString +------------------------------------------------------------------------------- +ToStringVector.cpp: +............................................................................... + +ToStringVector.cpp:: +PASSED: + REQUIRE( ::Catch::Detail::stringify(v) == "{ }" ) +with expansion: + "{ }" == "{ }" + +ToStringVector.cpp:: +PASSED: + REQUIRE( ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" ) +with expansion: + "{ { "hello" }, { "world" } }" + == + "{ { "hello" }, { "world" } }" + +------------------------------------------------------------------------------- +vector -> toString +------------------------------------------------------------------------------- +ToStringVector.cpp: +............................................................................... + +ToStringVector.cpp:: +PASSED: + REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" ) +with expansion: + "{ }" == "{ }" + +ToStringVector.cpp:: +PASSED: + REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42 }" ) +with expansion: + "{ 42 }" == "{ 42 }" + +ToStringVector.cpp:: +PASSED: + REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" ) +with expansion: + "{ 42, 250 }" == "{ 42, 250 }" + ------------------------------------------------------------------------------- vector -> toString ------------------------------------------------------------------------------- @@ -8884,6 +9164,6 @@ MiscTests.cpp:: PASSED: =============================================================================== -test cases: 173 | 122 passed | 47 failed | 4 failed as expected -assertions: 909 | 792 passed | 96 failed | 21 failed as expected +test cases: 186 | 134 passed | 48 failed | 4 failed as expected +assertions: 941 | 822 passed | 98 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index df8d91eb..6f09f338 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,6 @@ - + @@ -112,6 +112,7 @@ ExceptionTests.cpp: + @@ -692,6 +693,7 @@ Previous info should not be seen MessageTests.cpp: + MiscTests.cpp: @@ -735,6 +737,7 @@ MiscTests.cpp: + @@ -775,8 +778,25 @@ TrickyTests.cpp: + + + +EnumToString.cpp: + + +EnumToString.cpp: + + + + + + + + + + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 1f7e73f0..adbdba86 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -1029,6 +1029,105 @@ + + + + td == Approx(10.0) + + + StrongDoubleTypedef(10) == Approx( 10.0 ) + + + + + Approx(10.0) == td + + + Approx( 10.0 ) == StrongDoubleTypedef(10) + + + + + td != Approx(11.0) + + + StrongDoubleTypedef(10) != Approx( 11.0 ) + + + + + Approx(11.0) != td + + + Approx( 11.0 ) != StrongDoubleTypedef(10) + + + + + td <= Approx(10.0) + + + StrongDoubleTypedef(10) <= Approx( 10.0 ) + + + + + td <= Approx(11.0) + + + StrongDoubleTypedef(10) <= Approx( 11.0 ) + + + + + Approx(10.0) <= td + + + Approx( 10.0 ) <= StrongDoubleTypedef(10) + + + + + Approx(9.0) <= td + + + Approx( 9.0 ) <= StrongDoubleTypedef(10) + + + + + td >= Approx(9.0) + + + StrongDoubleTypedef(10) >= Approx( 9.0 ) + + + + + td >= Approx(10.0) + + + StrongDoubleTypedef(10) >= Approx( 10.0 ) + + + + + Approx(10.0) >= td + + + Approx( 10.0 ) >= StrongDoubleTypedef(10) + + + + + Approx(11.0) >= td + + + Approx( 11.0 ) >= StrongDoubleTypedef(10) + + + + @@ -8927,6 +9026,19 @@ spanner + + + + l == std::numeric_limits<long long>::max() + + + 9223372036854775807 (0x) +== +9223372036854775807 (0x) + + + +
@@ -9143,6 +9255,17 @@ spanner + + + + ptr.get() == 0 + + + 0 == 0 + + + + @@ -9512,6 +9635,54 @@ spanner + + + + ::Catch::Detail::stringify(e0) == "E2/V0" + + + "E2/V0" == "E2/V0" + + + + + ::Catch::Detail::stringify(e1) == "E2/V1" + + + "E2/V1" == "E2/V1" + + + + + ::Catch::Detail::stringify(e3) == "Unknown enum value 10" + + + "Unknown enum value 10" +== +"Unknown enum value 10" + + + + + + + + ::Catch::Detail::stringify(e0) == "0" + + + "{?}" == "0" + + + + + ::Catch::Detail::stringify(e1) == "1" + + + "{?}" == "1" + + + + @@ -9550,6 +9721,142 @@ spanner + + + + "{ }" == ::Catch::Detail::stringify(type{}) + + + "{ }" == "{ }" + + + + + "{ }" == ::Catch::Detail::stringify(value) + + + "{ }" == "{ }" + + + + + + + + "1.2f" == ::Catch::Detail::stringify(float(1.2)) + + + "1.2f" == "1.2f" + + + + + "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) + + + "{ 1.2f, 0 }" == "{ 1.2f, 0 }" + + + + + + + + "{ 0 }" == ::Catch::Detail::stringify(type{0}) + + + "{ 0 }" == "{ 0 }" + + + + + + + + "{ 0, 42, \"Catch me\" }" == ::Catch::Detail::stringify(value) + + + "{ 0, 42, "Catch me" }" +== +"{ 0, 42, "Catch me" }" + + + + + + + + "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) + + + "{ "hello", "world" }" +== +"{ "hello", "world" }" + + + + + + + + "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) + + + "{ { 42 }, { }, 1.2f }" +== +"{ { 42 }, { }, 1.2f }" + + + + + + + + ::Catch::Detail::stringify(v) == "{ }" + + + "{ }" == "{ }" + + + + + ::Catch::Detail::stringify(v) == "{ { \"hello\" }, { \"world\" } }" + + + "{ { "hello" }, { "world" } }" +== +"{ { "hello" }, { "world" } }" + + + + + + + + ::Catch::Detail::stringify(vv) == "{ }" + + + "{ }" == "{ }" + + + + + ::Catch::Detail::stringify(vv) == "{ 42 }" + + + "{ 42 }" == "{ 42 }" + + + + + ::Catch::Detail::stringify(vv) == "{ 42, 250 }" + + + "{ 42, 250 }" == "{ 42, 250 }" + + + + @@ -9769,7 +10076,7 @@ spanner
- + - + diff --git a/projects/SelfTest/EnumToString.cpp b/projects/SelfTest/EnumToString.cpp index eb80c747..7d18a292 100644 --- a/projects/SelfTest/EnumToString.cpp +++ b/projects/SelfTest/EnumToString.cpp @@ -28,7 +28,7 @@ TEST_CASE( "toString(enum w/operator<<)", "[toString][enum]" ) { // Enum class without user-provided stream operator enum class EnumClass1 { EnumClass1Value0, EnumClass1Value1 }; -TEST_CASE( "toString(enum class)", "[toString][enum][enumClass][c++11][.]" ) { +TEST_CASE( "toString(enum class)", "[toString][enum][enumClass]" ) { EnumClass1 e0 = EnumClass1::EnumClass1Value0; CHECK( ::Catch::Detail::stringify(e0) == "0" ); EnumClass1 e1 = EnumClass1::EnumClass1Value1; @@ -49,7 +49,7 @@ std::ostream& operator<<( std::ostream& os, EnumClass2 e2 ) { } } -TEST_CASE( "toString(enum class w/operator<<)", "[toString][enum][enumClass][c++11][.]" ) { +TEST_CASE( "toString(enum class w/operator<<)", "[toString][enum][enumClass]" ) { EnumClass2 e0 = EnumClass2::EnumClass2Value0; CHECK( ::Catch::Detail::stringify(e0) == "E2/V0" ); EnumClass2 e1 = EnumClass2::EnumClass2Value1; diff --git a/projects/SelfTest/MiscTests.cpp b/projects/SelfTest/MiscTests.cpp index 9d837822..87381b08 100644 --- a/projects/SelfTest/MiscTests.cpp +++ b/projects/SelfTest/MiscTests.cpp @@ -372,7 +372,7 @@ TEST_CASE( "XmlEncode" ) { } } -TEST_CASE( "long long", "[c++11][.]" ) { +TEST_CASE( "long long" ) { long long l = std::numeric_limits::max(); REQUIRE( l == std::numeric_limits::max() ); diff --git a/projects/SelfTest/ToStringTuple.cpp b/projects/SelfTest/ToStringTuple.cpp index dcd1d803..330e427e 100644 --- a/projects/SelfTest/ToStringTuple.cpp +++ b/projects/SelfTest/ToStringTuple.cpp @@ -2,7 +2,7 @@ #include -TEST_CASE( "tuple<>", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple<>", "[toString][tuple]" ) { typedef std::tuple<> type; CHECK( "{ }" == ::Catch::Detail::stringify(type{}) ); @@ -10,34 +10,34 @@ TEST_CASE( "tuple<>", "[toString][tuple][c++11][.]" ) CHECK( "{ }" == ::Catch::Detail::stringify(value) ); } -TEST_CASE( "tuple", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple", "[toString][tuple]" ) { typedef std::tuple type; CHECK( "{ 0 }" == ::Catch::Detail::stringify(type{0}) ); } -TEST_CASE( "tuple", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple", "[toString][tuple]" ) { typedef std::tuple type; CHECK( "1.2f" == ::Catch::Detail::stringify(float(1.2)) ); CHECK( "{ 1.2f, 0 }" == ::Catch::Detail::stringify(type{1.2f,0}) ); } -TEST_CASE( "tuple", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple", "[toString][tuple]" ) { typedef std::tuple type; CHECK( "{ \"hello\", \"world\" }" == ::Catch::Detail::stringify(type{"hello","world"}) ); } -TEST_CASE( "tuple,tuple<>,float>", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple,tuple<>,float>", "[toString][tuple]" ) { typedef std::tuple,std::tuple<>,float> type; type value { std::tuple{42}, {}, 1.2f }; CHECK( "{ { 42 }, { }, 1.2f }" == ::Catch::Detail::stringify(value) ); } -TEST_CASE( "tuple", "[toString][tuple][c++11][.]" ) +TEST_CASE( "tuple", "[toString][tuple]" ) { typedef std::tuple type; type value { nullptr, 42, "Catch me" }; diff --git a/projects/SelfTest/ToStringVector.cpp b/projects/SelfTest/ToStringVector.cpp index c70872c8..df9c55ab 100644 --- a/projects/SelfTest/ToStringVector.cpp +++ b/projects/SelfTest/ToStringVector.cpp @@ -48,7 +48,7 @@ namespace { }; } -TEST_CASE( "vector -> toString", "[toString][vector,allocator][c++11][.]" ) { +TEST_CASE( "vector -> toString", "[toString][vector,allocator]" ) { std::vector > vv; REQUIRE( ::Catch::Detail::stringify(vv) == "{ }" ); vv.push_back( 42 ); @@ -57,7 +57,7 @@ TEST_CASE( "vector -> toString", "[toString][vector,allocator][c+ REQUIRE( ::Catch::Detail::stringify(vv) == "{ 42, 250 }" ); } -TEST_CASE( "vec> -> toString", "[toString][vector,allocator][c++11][.]" ) { +TEST_CASE( "vec> -> toString", "[toString][vector,allocator]" ) { using inner = std::vector>; using vector = std::vector; vector v; diff --git a/projects/SelfTest/TrickyTests.cpp b/projects/SelfTest/TrickyTests.cpp index ca8c4518..4ebb0f29 100644 --- a/projects/SelfTest/TrickyTests.cpp +++ b/projects/SelfTest/TrickyTests.cpp @@ -383,7 +383,7 @@ TEST_CASE( "pointer to class", "[Tricky]" ) #include -TEST_CASE( "null_ptr", "[Tricky][c++11][.]" ) +TEST_CASE( "null_ptr", "[Tricky]" ) { std::unique_ptr ptr; REQUIRE(ptr.get() == nullptr); diff --git a/scripts/approvalTests.py b/scripts/approvalTests.py index 3b71be3e..016997cc 100755 --- a/scripts/approvalTests.py +++ b/scripts/approvalTests.py @@ -145,15 +145,15 @@ print("Running approvals against executable:") print(" " + cmdPath) # Standard console reporter -approve("console.std", ["~[c++11]~[!nonportable]", "--order", "lex"]) +approve("console.std", ["~[!nonportable]", "--order", "lex"]) # console reporter, include passes, warn about No Assertions -approve("console.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "--order", "lex"]) +approve("console.sw", ["~[!nonportable]", "-s", "-w", "NoAssertions", "--order", "lex"]) # console reporter, include passes, warn about No Assertions, limit failures to first 4 -approve("console.swa4", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex"]) +approve("console.swa4", ["~[!nonportable]", "-s", "-w", "NoAssertions", "-x", "4", "--order", "lex"]) # junit reporter, include passes, warn about No Assertions -approve("junit.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex"]) +approve("junit.sw", ["~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "junit", "--order", "lex"]) # xml reporter, include passes, warn about No Assertions -approve("xml.sw", ["~[c++11]~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex"]) +approve("xml.sw", ["~[!nonportable]", "-s", "-w", "NoAssertions", "-r", "xml", "--order", "lex"]) if overallResult != 0: print("If these differences are expected, run approve.py to approve new baselines.")