From 33e047a16521f0044f32c84a0fd5fd561d3fd25c Mon Sep 17 00:00:00 2001 From: Riyuzak2510 Date: Wed, 30 Jul 2025 22:39:29 +0530 Subject: [PATCH 1/3] Add Unscoped Capture Logger and Add Unit Tests --- src/catch2/catch_message.cpp | 11 ++ src/catch2/catch_message.hpp | 31 +++++ .../Baselines/automake.sw.approved.txt | 4 + .../Baselines/automake.sw.multi.approved.txt | 4 + .../Baselines/compact.sw.approved.txt | 9 +- .../Baselines/compact.sw.multi.approved.txt | 9 +- .../Baselines/console.std.approved.txt | 37 +++++- .../Baselines/console.sw.approved.txt | 74 ++++++++++- .../Baselines/console.sw.multi.approved.txt | 74 ++++++++++- .../SelfTest/Baselines/junit.sw.approved.txt | 32 ++++- .../Baselines/junit.sw.multi.approved.txt | 32 ++++- .../Baselines/sonarqube.sw.approved.txt | 30 +++++ .../Baselines/sonarqube.sw.multi.approved.txt | 30 +++++ tests/SelfTest/Baselines/tap.sw.approved.txt | 12 +- .../Baselines/tap.sw.multi.approved.txt | 12 +- .../Baselines/teamcity.sw.approved.txt | 11 ++ .../Baselines/teamcity.sw.multi.approved.txt | 11 ++ tests/SelfTest/Baselines/xml.sw.approved.txt | 121 +++++++++++++++++- .../Baselines/xml.sw.multi.approved.txt | 121 +++++++++++++++++- tests/SelfTest/UsageTests/Message.tests.cpp | 39 ++++++ 20 files changed, 686 insertions(+), 18 deletions(-) diff --git a/src/catch2/catch_message.cpp b/src/catch2/catch_message.cpp index d3914a8059..9f5d75ba3c 100644 --- a/src/catch2/catch_message.cpp +++ b/src/catch2/catch_message.cpp @@ -112,4 +112,15 @@ namespace Catch { m_captured++; } + void Capturer::captureUnscopedValue( size_t index, std::string const& value ) { + m_messages[index].message += value; + getResultCapture().emplaceUnscopedMessage(Catch::MessageBuilder( + m_messages[index].macroName, + m_messages[index].lineInfo, + m_messages[index].type) << m_messages[index].message); + if(index == m_messages.size() - 1){ + m_messages.clear(); + } + } + } // end namespace Catch diff --git a/src/catch2/catch_message.hpp b/src/catch2/catch_message.hpp index 0a738341c2..85982ced0f 100644 --- a/src/catch2/catch_message.hpp +++ b/src/catch2/catch_message.hpp @@ -73,6 +73,19 @@ namespace Catch { ~Capturer(); + void captureUnscopedValue( size_t index, std::string const& value ); + + template + void captureUnscopedValues( size_t index, T const& value ) { + captureUnscopedValue( index, Catch::Detail::stringify( value ) ); + } + + template + void captureUnscopedValues( size_t index, T const& value, Ts const&... values ) { + captureUnscopedValue( index, Catch::Detail::stringify(value) ); + captureUnscopedValues( index+1, values... ); + } + void captureValue( size_t index, std::string const& value ); template @@ -85,6 +98,10 @@ namespace Catch { captureValue( index, Catch::Detail::stringify(value) ); captureValues( index+1, values... ); } + + std::vector getMessageDetails() const { + return m_messages; + } }; } // end namespace Catch @@ -105,6 +122,14 @@ namespace Catch { #__VA_ARGS__##_catch_sr ); \ varName.captureValues( 0, __VA_ARGS__ ) +/////////////////////////////////////////////////////////////////////////////// +#define INTERNAL_CATCH_UNSCOPED_CAPTURE( varName, macroName, ... ) \ + Catch::Capturer varName( macroName##_catch_sr, \ + CATCH_INTERNAL_LINEINFO, \ + Catch::ResultWas::Info, \ + #__VA_ARGS__##_catch_sr ); \ + varName.captureUnscopedValues( 0, __VA_ARGS__ ); + /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO( macroName, log ) \ const Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log ) @@ -120,6 +145,7 @@ namespace Catch { #define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg ) #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ ) + #define CATCH_UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_UNSCOPED_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_UNSCOPED_CAPTURE", __VA_ARGS__ ) #elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) @@ -127,6 +153,8 @@ namespace Catch { #define CATCH_UNSCOPED_INFO( msg ) (void)(0) #define CATCH_WARN( msg ) (void)(0) #define CATCH_CAPTURE( ... ) (void)(0) + #define CATCH_UNSCOPED_CAPTURE( ... ) (void)(0) + #elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE) @@ -134,6 +162,8 @@ namespace Catch { #define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg ) #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg ) #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ ) + #define UNSCOPED_CAPTURE( ... ) INTERNAL_CATCH_UNSCOPED_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "UNSCOPED_CAPTURE", __VA_ARGS__ ) + #elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) @@ -141,6 +171,7 @@ namespace Catch { #define UNSCOPED_INFO( msg ) (void)(0) #define WARN( msg ) (void)(0) #define CAPTURE( ... ) (void)(0) + #define UNSCOPED_CAPTURE( ... ) (void)(0) #endif // end of user facing macro declarations diff --git a/tests/SelfTest/Baselines/automake.sw.approved.txt b/tests/SelfTest/Baselines/automake.sw.approved.txt index 4a6886d6c2..e21373a89b 100644 --- a/tests/SelfTest/Baselines/automake.sw.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.approved.txt @@ -297,6 +297,8 @@ Message from section two :test-result: PASS Tracker :test-result: PASS Trim strings :test-result: PASS Type conversions of RangeEquals and similar +:test-result: PASS UNSCOPED CAPTURE can deal with complex expressions +:test-result: PASS UNSCOPED_CAPTURE parses string and character constants :test-result: FAIL Unexpected exceptions can be translated :test-result: PASS Upcasting special member functions :test-result: PASS Usage of AllMatch range matcher @@ -396,6 +398,8 @@ b1! :test-result: PASS shortened hide tags are split apart :test-result: SKIP skipped tests can optionally provide a reason :test-result: PASS splitString +:test-result: FAIL stacks unscoped capture for vector +:test-result: FAIL stacks unscoped capture in loops :test-result: FAIL stacks unscoped info in loops :test-result: PASS startsWith :test-result: PASS std::map is convertible string diff --git a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt index b0d30b87d9..e0769e6d57 100644 --- a/tests/SelfTest/Baselines/automake.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/automake.sw.multi.approved.txt @@ -290,6 +290,8 @@ :test-result: PASS Tracker :test-result: PASS Trim strings :test-result: PASS Type conversions of RangeEquals and similar +:test-result: PASS UNSCOPED CAPTURE can deal with complex expressions +:test-result: PASS UNSCOPED_CAPTURE parses string and character constants :test-result: FAIL Unexpected exceptions can be translated :test-result: PASS Upcasting special member functions :test-result: PASS Usage of AllMatch range matcher @@ -385,6 +387,8 @@ :test-result: PASS shortened hide tags are split apart :test-result: SKIP skipped tests can optionally provide a reason :test-result: PASS splitString +:test-result: FAIL stacks unscoped capture for vector +:test-result: FAIL stacks unscoped capture in loops :test-result: FAIL stacks unscoped info in loops :test-result: PASS startsWith :test-result: PASS std::map is convertible string diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index 323da08ee7..ed0ce9d830 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -2194,6 +2194,8 @@ MatchersRanges.tests.cpp:: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +Message.tests.cpp:: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +Message.tests.cpp:: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' Exception.tests.cpp:: failed: unexpected exception with message: '3.14000000000000012' UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 @@ -2720,6 +2722,9 @@ Skip.tests.cpp:: skipped: 'skipping because answer = 43' StringManip.tests.cpp:: passed: splitStringRef("", ','), Equals(std::vector()) for: { } Equals: { } StringManip.tests.cpp:: passed: splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } StringManip.tests.cpp:: passed: splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } +Message.tests.cpp:: failed: false with 1 message: 'input := { 7, 8, 9 }' +Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' Message.tests.cpp:: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' Message.tests.cpp:: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' StringManip.tests.cpp:: passed: !(startsWith("", 'c')) for: !false @@ -2884,7 +2889,7 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: -test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected -assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected +test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 57b54ce1d9..9c8842afb3 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -2187,6 +2187,8 @@ MatchersRanges.tests.cpp:: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +Message.tests.cpp:: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +Message.tests.cpp:: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' Exception.tests.cpp:: failed: unexpected exception with message: '3.14000000000000012' UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 @@ -2709,6 +2711,9 @@ Skip.tests.cpp:: skipped: 'skipping because answer = 43' StringManip.tests.cpp:: passed: splitStringRef("", ','), Equals(std::vector()) for: { } Equals: { } StringManip.tests.cpp:: passed: splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } StringManip.tests.cpp:: passed: splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } +Message.tests.cpp:: failed: false with 1 message: 'input := { 7, 8, 9 }' +Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' Message.tests.cpp:: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' Message.tests.cpp:: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' StringManip.tests.cpp:: passed: !(startsWith("", 'c')) for: !false @@ -2873,7 +2878,7 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: -test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected -assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected +test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index c849d5ee4d..143808ad7b 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1678,6 +1678,39 @@ Skip.tests.cpp:: SKIPPED: explicitly with message: skipping because answer = 43 +------------------------------------------------------------------------------- +stacks unscoped capture for vector +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with message: + input := { 7, 8, 9 } + +------------------------------------------------------------------------------- +stacks unscoped capture in loops +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 1 to 3..." := "Count 1 to 3..." + input := 1 + input := 2 + input := 3 + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 4 to 6..." := "Count 4 to 6..." + input := 4 + input := 5 + input := 6 + ------------------------------------------------------------------------------- stacks unscoped info in loops ------------------------------------------------------------------------------- @@ -1719,6 +1752,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 435 | 335 passed | 76 failed | 7 skipped | 17 failed as expected -assertions: 2278 | 2101 passed | 136 failed | 41 failed as expected +test cases: 439 | 337 passed | 78 failed | 7 skipped | 17 failed as expected +assertions: 2283 | 2103 passed | 139 failed | 41 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 394c4182f1..8393dfc243 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -14232,6 +14232,43 @@ MatchersRanges.tests.cpp:: PASSED: with expansion: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +------------------------------------------------------------------------------- +UNSCOPED CAPTURE can deal with complex expressions +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: PASSED: +with messages: + a := 1 + b := 2 + c := 3 + a + b := 3 + a+b := 3 + c > b := true + a == 1 := true + +------------------------------------------------------------------------------- +UNSCOPED_CAPTURE parses string and character constants +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: PASSED: +with messages: + ("comma, in string", "escaped, \", ") := "escaped, ", " + "single quote in string,'," := "single quote in string,'," + "some escapes, \\,\\\\" := "some escapes, \,\\" + "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[ + <" + '"' := '"' + '\'' := ''' + ',' := ',' + '}' := '}' + ')' := ')' + '(' := '(' + '{' := '{' + ------------------------------------------------------------------------------- Unexpected exceptions can be translated ------------------------------------------------------------------------------- @@ -18117,6 +18154,39 @@ StringManip.tests.cpp:: PASSED: with expansion: { abc, def } Equals: { abc, def } +------------------------------------------------------------------------------- +stacks unscoped capture for vector +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with message: + input := { 7, 8, 9 } + +------------------------------------------------------------------------------- +stacks unscoped capture in loops +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 1 to 3..." := "Count 1 to 3..." + input := 1 + input := 2 + input := 3 + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 4 to 6..." := "Count 4 to 6..." + input := 4 + input := 5 + input := 6 + ------------------------------------------------------------------------------- stacks unscoped info in loops ------------------------------------------------------------------------------- @@ -19267,6 +19337,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected -assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected +test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 018864fe8d..0d186f1452 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -14225,6 +14225,43 @@ MatchersRanges.tests.cpp:: PASSED: with expansion: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +------------------------------------------------------------------------------- +UNSCOPED CAPTURE can deal with complex expressions +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: PASSED: +with messages: + a := 1 + b := 2 + c := 3 + a + b := 3 + a+b := 3 + c > b := true + a == 1 := true + +------------------------------------------------------------------------------- +UNSCOPED_CAPTURE parses string and character constants +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: PASSED: +with messages: + ("comma, in string", "escaped, \", ") := "escaped, ", " + "single quote in string,'," := "single quote in string,'," + "some escapes, \\,\\\\" := "some escapes, \,\\" + "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[ + <" + '"' := '"' + '\'' := ''' + ',' := ',' + '}' := '}' + ')' := ')' + '(' := '(' + '{' := '{' + ------------------------------------------------------------------------------- Unexpected exceptions can be translated ------------------------------------------------------------------------------- @@ -18106,6 +18143,39 @@ StringManip.tests.cpp:: PASSED: with expansion: { abc, def } Equals: { abc, def } +------------------------------------------------------------------------------- +stacks unscoped capture for vector +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with message: + input := { 7, 8, 9 } + +------------------------------------------------------------------------------- +stacks unscoped capture in loops +------------------------------------------------------------------------------- +Message.tests.cpp: +............................................................................... + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 1 to 3..." := "Count 1 to 3..." + input := 1 + input := 2 + input := 3 + +Message.tests.cpp:: FAILED: + CHECK( false ) +with messages: + "Count 4 to 6..." := "Count 4 to 6..." + input := 4 + input := 5 + input := 6 + ------------------------------------------------------------------------------- stacks unscoped info in loops ------------------------------------------------------------------------------- @@ -19256,6 +19326,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 435 | 317 passed | 95 failed | 6 skipped | 17 failed as expected -assertions: 2299 | 2101 passed | 157 failed | 41 failed as expected +test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index 42a98dd0a4..c268ae8541 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -1675,6 +1675,8 @@ at Exception.tests.cpp: + + FAILED: @@ -2292,6 +2294,34 @@ at Skip.tests.cpp: + + +FAILED: + CHECK( false ) +input := { 7, 8, 9 } +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +"Count 1 to 3..." := "Count 1 to 3..." +input := 1 +input := 2 +input := 3 +at Message.tests.cpp: + + +FAILED: + CHECK( false ) +"Count 4 to 6..." := "Count 4 to 6..." +input := 4 +input := 5 +input := 6 +at Message.tests.cpp: + + FAILED: diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index 5f17b49dc5..a89fa7a987 100644 --- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,6 +1,6 @@ - + @@ -1674,6 +1674,8 @@ at Exception.tests.cpp: + + FAILED: @@ -2291,6 +2293,34 @@ at Skip.tests.cpp: + + +FAILED: + CHECK( false ) +input := { 7, 8, 9 } +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +"Count 1 to 3..." := "Count 1 to 3..." +input := 1 +input := 2 +input := 3 +at Message.tests.cpp: + + +FAILED: + CHECK( false ) +"Count 4 to 6..." := "Count 4 to 6..." +input := 4 +input := 5 +input := 6 +at Message.tests.cpp: + + FAILED: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index 9f1fbda6ee..de252bfafd 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -1822,6 +1822,8 @@ at Message.tests.cpp: + + FAILED: @@ -1871,6 +1873,34 @@ FAILED: REQUIRE( false ) hi i := 7 +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +input := { 7, 8, 9 } +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +"Count 1 to 3..." := "Count 1 to 3..." +input := 1 +input := 2 +input := 3 +at Message.tests.cpp: + + +FAILED: + CHECK( false ) +"Count 4 to 6..." := "Count 4 to 6..." +input := 4 +input := 5 +input := 6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index ce9bd5343e..f99cdb7d8f 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -1821,6 +1821,8 @@ at Message.tests.cpp: + + FAILED: @@ -1870,6 +1872,34 @@ FAILED: REQUIRE( false ) hi i := 7 +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +input := { 7, 8, 9 } +at Message.tests.cpp: + + + + +FAILED: + CHECK( false ) +"Count 1 to 3..." := "Count 1 to 3..." +input := 1 +input := 2 +input := 3 +at Message.tests.cpp: + + +FAILED: + CHECK( false ) +"Count 4 to 6..." := "Count 4 to 6..." +input := 4 +input := 5 +input := 6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 699d78c2cd..7c3348a1ab 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -3395,6 +3395,10 @@ ok {test-number} - a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered eleme ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +# UNSCOPED CAPTURE can deal with complex expressions +ok {test-number} - with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +# UNSCOPED_CAPTURE parses string and character constants +ok {test-number} - with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' # Unexpected exceptions can be translated not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions @@ -4363,6 +4367,12 @@ ok {test-number} - splitStringRef("", ','), Equals(std::vector()) for ok {test-number} - splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } # splitString ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } +# stacks unscoped capture for vector +not ok {test-number} - false with 1 message: 'input := { 7, 8, 9 }' +# stacks unscoped capture in loops +not ok {test-number} - false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +# stacks unscoped capture in loops +not ok {test-number} - false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' # stacks unscoped info in loops not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' # stacks unscoped info in loops @@ -4619,5 +4629,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2311 +1..2316 diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 6b18914c11..15ed73f4e0 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -3388,6 +3388,10 @@ ok {test-number} - a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered eleme ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } +# UNSCOPED CAPTURE can deal with complex expressions +ok {test-number} - with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +# UNSCOPED_CAPTURE parses string and character constants +ok {test-number} - with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' # Unexpected exceptions can be translated not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions @@ -4352,6 +4356,12 @@ ok {test-number} - splitStringRef("", ','), Equals(std::vector()) for ok {test-number} - splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } # splitString ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } +# stacks unscoped capture for vector +not ok {test-number} - false with 1 message: 'input := { 7, 8, 9 }' +# stacks unscoped capture in loops +not ok {test-number} - false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +# stacks unscoped capture in loops +not ok {test-number} - false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' # stacks unscoped info in loops not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' # stacks unscoped info in loops @@ -4608,5 +4618,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -1..2311 +1..2316 diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index 853f3d8048..d7e95a4c02 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -721,6 +721,10 @@ ##teamcity[testFinished name='Trim strings' duration="{duration}"] ##teamcity[testStarted name='Type conversions of RangeEquals and similar'] ##teamcity[testFinished name='Type conversions of RangeEquals and similar' duration="{duration}"] +##teamcity[testStarted name='UNSCOPED CAPTURE can deal with complex expressions'] +##teamcity[testFinished name='UNSCOPED CAPTURE can deal with complex expressions' duration="{duration}"] +##teamcity[testStarted name='UNSCOPED_CAPTURE parses string and character constants'] +##teamcity[testFinished name='UNSCOPED_CAPTURE parses string and character constants' duration="{duration}"] ##teamcity[testStarted name='Unexpected exceptions can be translated'] ##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:|n...............................................................................|n|nException.tests.cpp:|nunexpected exception with message:|n "3.14000000000000012"'] ##teamcity[testFinished name='Unexpected exceptions can be translated' duration="{duration}"] @@ -965,6 +969,13 @@ loose text artifact ##teamcity[testFinished name='skipped tests can optionally provide a reason' duration="{duration}"] ##teamcity[testStarted name='splitString'] ##teamcity[testFinished name='splitString' duration="{duration}"] +##teamcity[testStarted name='stacks unscoped capture for vector'] +##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "input := { 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='stacks unscoped capture for vector' duration="{duration}"] +##teamcity[testStarted name='stacks unscoped capture in loops'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3..." := "Count 1 to 3...""|n "input := 1"|n "input := 2"|n "input := 3"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6..." := "Count 4 to 6...""|n "input := 4"|n "input := 5"|n "input := 6"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='stacks unscoped capture in loops' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped info in loops'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|nexpression failed with messages:|n "Count 4 to 6..."|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt index 10e318de5c..96d2c0cfa3 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -721,6 +721,10 @@ ##teamcity[testFinished name='Trim strings' duration="{duration}"] ##teamcity[testStarted name='Type conversions of RangeEquals and similar'] ##teamcity[testFinished name='Type conversions of RangeEquals and similar' duration="{duration}"] +##teamcity[testStarted name='UNSCOPED CAPTURE can deal with complex expressions'] +##teamcity[testFinished name='UNSCOPED CAPTURE can deal with complex expressions' duration="{duration}"] +##teamcity[testStarted name='UNSCOPED_CAPTURE parses string and character constants'] +##teamcity[testFinished name='UNSCOPED_CAPTURE parses string and character constants' duration="{duration}"] ##teamcity[testStarted name='Unexpected exceptions can be translated'] ##teamcity[testFailed name='Unexpected exceptions can be translated' message='Exception.tests.cpp:|n...............................................................................|n|nException.tests.cpp:|nunexpected exception with message:|n "3.14000000000000012"'] ##teamcity[testFinished name='Unexpected exceptions can be translated' duration="{duration}"] @@ -964,6 +968,13 @@ ##teamcity[testFinished name='skipped tests can optionally provide a reason' duration="{duration}"] ##teamcity[testStarted name='splitString'] ##teamcity[testFinished name='splitString' duration="{duration}"] +##teamcity[testStarted name='stacks unscoped capture for vector'] +##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "input := { 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='stacks unscoped capture for vector' duration="{duration}"] +##teamcity[testStarted name='stacks unscoped capture in loops'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3..." := "Count 1 to 3...""|n "input := 1"|n "input := 2"|n "input := 3"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6..." := "Count 4 to 6...""|n "input := 4"|n "input := 5"|n "input := 6"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFinished name='stacks unscoped capture in loops' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped info in loops'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|nexpression failed with messages:|n "Count 4 to 6..."|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 48b0e26061..293cd435d7 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -16448,6 +16448,66 @@ There is no extra whitespace here + + + a := 1 + + + b := 2 + + + c := 3 + + + a + b := 3 + + + a+b := 3 + + + c > b := true + + + a == 1 := true + + + + + + ("comma, in string", "escaped, \", ") := "escaped, ", " + + + "single quote in string,'," := "single quote in string,'," + + + "some escapes, \\,\\\\" := "some escapes, \,\\" + + + "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" + + + '"' := '"' + + + '\'' := ''' + + + ',' := ',' + + + '}' := '}' + + + ')' := ')' + + + '(' := '(' + + + '{' := '{' + + + 3.14000000000000012 @@ -21020,6 +21080,63 @@ Approx( -1.95996398454005449 ) + + + input := { 7, 8, 9 } + + + + false + + + false + + + + + + + "Count 1 to 3..." := "Count 1 to 3..." + + + input := 1 + + + input := 2 + + + input := 3 + + + + false + + + false + + + + "Count 4 to 6..." := "Count 4 to 6..." + + + input := 4 + + + input := 5 + + + input := 6 + + + + false + + + false + + + + Count 1 to 3... @@ -22286,6 +22403,6 @@ Approx( -1.95996398454005449 ) - - + + diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index f0498aff54..dce9587c19 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -16448,6 +16448,66 @@ There is no extra whitespace here + + + a := 1 + + + b := 2 + + + c := 3 + + + a + b := 3 + + + a+b := 3 + + + c > b := true + + + a == 1 := true + + + + + + ("comma, in string", "escaped, \", ") := "escaped, ", " + + + "single quote in string,'," := "single quote in string,'," + + + "some escapes, \\,\\\\" := "some escapes, \,\\" + + + "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" + + + '"' := '"' + + + '\'' := ''' + + + ',' := ',' + + + '}' := '}' + + + ')' := ')' + + + '(' := '(' + + + '{' := '{' + + + 3.14000000000000012 @@ -21019,6 +21079,63 @@ Approx( -1.95996398454005449 ) + + + input := { 7, 8, 9 } + + + + false + + + false + + + + + + + "Count 1 to 3..." := "Count 1 to 3..." + + + input := 1 + + + input := 2 + + + input := 3 + + + + false + + + false + + + + "Count 4 to 6..." := "Count 4 to 6..." + + + input := 4 + + + input := 5 + + + input := 6 + + + + false + + + false + + + + Count 1 to 3... @@ -22285,6 +22402,6 @@ Approx( -1.95996398454005449 ) - - + + diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp index 07d3ee7b13..42bf9f65e7 100644 --- a/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/tests/SelfTest/UsageTests/Message.tests.cpp @@ -212,6 +212,38 @@ TEST_CASE( "CAPTURE can deal with complex expressions", "[messages][capture]" ) SUCCEED(); } +TEST_CASE( "UNSCOPED CAPTURE can deal with complex expressions", "[messages][unscoped][capture]" ) { + int a = 1; + int b = 2; + int c = 3; + UNSCOPED_CAPTURE( a, b, c, a + b, a+b, c > b, a == 1 ); + SUCCEED(); +} +template < typename T> +static void unscoped_capture( T input ) { UNSCOPED_CAPTURE(input) } + +TEST_CASE( "stacks unscoped capture in loops", "[failing][unscoped][capture]" ) { + UNSCOPED_CAPTURE( "Count 1 to 3..." ); + for ( int i = 1; i <= 3; i++ ) { + unscoped_capture( i ); + } + CHECK( false ); + UNSCOPED_CAPTURE( "Count 4 to 6..." ); + for ( int i = 4; i <= 6; i++ ) { + unscoped_capture( i ); + } + CHECK( false ); +} + +TEST_CASE( "stacks unscoped capture for vector", "[failing][unscoped][capture]" ) { + { + std::vector vec { 7, 8, 9 }; + unscoped_capture( vec); + } + CHECK( false ); +} + + #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-value" // In (1, 2), the "1" is unused ... @@ -290,6 +322,13 @@ TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]" SUCCEED(); } +TEST_CASE("UNSCOPED_CAPTURE parses string and character constants", "[messages][capture]") { + UNSCOPED_CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\"); + UNSCOPED_CAPTURE( "some, ), unmatched, } prenheses {[<" ); + UNSCOPED_CAPTURE( '"', '\'', ',', '}', ')', '(', '{' ); + SUCCEED(); +} + #ifdef __clang__ #pragma clang diagnostic pop #endif From e91c43140445fcdc1f5564d367394d1eb094bdb0 Mon Sep 17 00:00:00 2001 From: Riyuzak2510 Date: Wed, 6 Aug 2025 22:14:30 +0530 Subject: [PATCH 2/3] Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE --- tests/SelfTest/Baselines/compact.sw.approved.txt | 5 +++++ tests/SelfTest/Baselines/compact.sw.multi.approved.txt | 5 +++++ tests/SelfTest/Baselines/console.std.approved.txt | 5 +++++ tests/SelfTest/Baselines/console.sw.approved.txt | 5 +++++ tests/SelfTest/Baselines/console.sw.multi.approved.txt | 5 +++++ tests/SelfTest/Baselines/junit.sw.approved.txt | 4 ++++ tests/SelfTest/Baselines/junit.sw.multi.approved.txt | 4 ++++ tests/SelfTest/Baselines/tap.sw.approved.txt | 4 ++++ tests/SelfTest/Baselines/tap.sw.multi.approved.txt | 4 ++++ tests/SelfTest/Baselines/xml.sw.approved.txt | 9 +++++++-- tests/SelfTest/Baselines/xml.sw.multi.approved.txt | 9 +++++++-- tests/SelfTest/UsageTests/Message.tests.cpp | 4 ++-- 12 files changed, 57 insertions(+), 6 deletions(-) diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index ed0ce9d830..ae9433b4b6 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -2889,7 +2889,12 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: +<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected +======= +test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 9c8842afb3..6a6da732da 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -2878,7 +2878,12 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: +<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected +======= +test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index 143808ad7b..b83a603ed6 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1752,6 +1752,11 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== +<<<<<<< HEAD test cases: 439 | 337 passed | 78 failed | 7 skipped | 17 failed as expected assertions: 2283 | 2103 passed | 139 failed | 41 failed as expected +======= +test cases: 438 | 336 passed | 78 failed | 7 skipped | 17 failed as expected +assertions: 2276 | 2096 passed | 139 failed | 41 failed as expected +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 8393dfc243..488630258e 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -19337,6 +19337,11 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== +<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected +======= +test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 0d186f1452..3b446dffb3 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -19326,6 +19326,11 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== +<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected +======= +test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected +assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index c268ae8541..96bfe05a3f 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,11 @@ +<<<<<<< HEAD +======= + +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index a89fa7a987..26335ff3e1 100644 --- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,6 +1,10 @@ +<<<<<<< HEAD +======= + +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 7c3348a1ab..8974c639f3 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -4629,5 +4629,9 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - +<<<<<<< HEAD 1..2316 +======= +1..2309 +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 15ed73f4e0..776a466338 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -4618,5 +4618,9 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - +<<<<<<< HEAD 1..2316 +======= +1..2309 +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 293cd435d7..1cd0a2a4db 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -21080,7 +21080,7 @@ Approx( -1.95996398454005449 ) - + input := { 7, 8, 9 } @@ -21094,7 +21094,7 @@ Approx( -1.95996398454005449 ) - + "Count 1 to 3..." := "Count 1 to 3..." @@ -22403,6 +22403,11 @@ Approx( -1.95996398454005449 ) +<<<<<<< HEAD +======= + + +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index dce9587c19..a186e525b3 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -21079,7 +21079,7 @@ Approx( -1.95996398454005449 ) - + input := { 7, 8, 9 } @@ -21093,7 +21093,7 @@ Approx( -1.95996398454005449 ) - + "Count 1 to 3..." := "Count 1 to 3..." @@ -22402,6 +22402,11 @@ Approx( -1.95996398454005449 ) +<<<<<<< HEAD +======= + + +>>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp index 42bf9f65e7..1dbc33c921 100644 --- a/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/tests/SelfTest/UsageTests/Message.tests.cpp @@ -222,7 +222,7 @@ TEST_CASE( "UNSCOPED CAPTURE can deal with complex expressions", "[messages][uns template < typename T> static void unscoped_capture( T input ) { UNSCOPED_CAPTURE(input) } -TEST_CASE( "stacks unscoped capture in loops", "[failing][unscoped][capture]" ) { +TEST_CASE( "stacks unscoped capture in loops", "[failing][.][unscoped][capture]" ) { UNSCOPED_CAPTURE( "Count 1 to 3..." ); for ( int i = 1; i <= 3; i++ ) { unscoped_capture( i ); @@ -235,7 +235,7 @@ TEST_CASE( "stacks unscoped capture in loops", "[failing][unscoped][capture]" ) CHECK( false ); } -TEST_CASE( "stacks unscoped capture for vector", "[failing][unscoped][capture]" ) { +TEST_CASE( "stacks unscoped capture for vector", "[failing][.][unscoped][capture]" ) { { std::vector vec { 7, 8, 9 }; unscoped_capture( vec); From 5abeb26684576591e4156813a18bce8a5b0da48d Mon Sep 17 00:00:00 2001 From: Riyuzak2510 Date: Wed, 13 Aug 2025 11:51:43 +0530 Subject: [PATCH 3/3] Refactoring Code to Adjust Scoped Logic into the common constructor for Capturer --- src/catch2/catch_message.cpp | 30 +++++----- src/catch2/catch_message.hpp | 50 ++++++---------- .../Baselines/compact.sw.approved.txt | 15 ++--- .../Baselines/compact.sw.multi.approved.txt | 15 ++--- .../Baselines/console.std.approved.txt | 23 +++---- .../Baselines/console.sw.approved.txt | 60 +++++++++---------- .../Baselines/console.sw.multi.approved.txt | 60 +++++++++---------- .../SelfTest/Baselines/junit.sw.approved.txt | 22 +++---- .../Baselines/junit.sw.multi.approved.txt | 22 +++---- .../Baselines/sonarqube.sw.approved.txt | 18 +++--- .../Baselines/sonarqube.sw.multi.approved.txt | 18 +++--- tests/SelfTest/Baselines/tap.sw.approved.txt | 14 ++--- .../Baselines/tap.sw.multi.approved.txt | 14 ++--- .../Baselines/teamcity.sw.approved.txt | 6 +- .../Baselines/teamcity.sw.multi.approved.txt | 6 +- tests/SelfTest/Baselines/xml.sw.approved.txt | 59 +++++++++--------- .../Baselines/xml.sw.multi.approved.txt | 59 +++++++++--------- tests/SelfTest/UsageTests/Message.tests.cpp | 2 +- 18 files changed, 212 insertions(+), 281 deletions(-) diff --git a/src/catch2/catch_message.cpp b/src/catch2/catch_message.cpp index 9f5d75ba3c..ba269cfb80 100644 --- a/src/catch2/catch_message.cpp +++ b/src/catch2/catch_message.cpp @@ -39,8 +39,9 @@ namespace Catch { Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, - StringRef names ): + StringRef names, bool scoped): m_resultCapture( getResultCapture() ) { + isScoped = scoped; auto trimmed = [&] (size_t start, size_t end) { while (names[start] == ',' || isspace(static_cast(names[start]))) { ++start; @@ -106,20 +107,19 @@ namespace Catch { } void Capturer::captureValue( size_t index, std::string const& value ) { - assert( index < m_messages.size() ); - m_messages[index].message += value; - m_resultCapture.pushScopedMessage( m_messages[index] ); - m_captured++; - } - - void Capturer::captureUnscopedValue( size_t index, std::string const& value ) { - m_messages[index].message += value; - getResultCapture().emplaceUnscopedMessage(Catch::MessageBuilder( - m_messages[index].macroName, - m_messages[index].lineInfo, - m_messages[index].type) << m_messages[index].message); - if(index == m_messages.size() - 1){ - m_messages.clear(); + if(isScoped){ + assert( index < m_messages.size() ); + m_messages[index].message += value; + m_resultCapture.pushScopedMessage( m_messages[index] ); + m_captured++; + } else { + getResultCapture().emplaceUnscopedMessage(Catch::MessageBuilder( + m_messages[index].macroName, + m_messages[index].lineInfo, + m_messages[index].type) << value); + if(index == m_messages.size() - 1){ + m_messages.clear(); + } } } diff --git a/src/catch2/catch_message.hpp b/src/catch2/catch_message.hpp index 85982ced0f..fef2a65e48 100644 --- a/src/catch2/catch_message.hpp +++ b/src/catch2/catch_message.hpp @@ -65,27 +65,15 @@ namespace Catch { std::vector m_messages; IResultCapture& m_resultCapture; size_t m_captured = 0; + bool isScoped; public: - Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ); + Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names, bool scoped ); Capturer(Capturer const&) = delete; Capturer& operator=(Capturer const&) = delete; ~Capturer(); - void captureUnscopedValue( size_t index, std::string const& value ); - - template - void captureUnscopedValues( size_t index, T const& value ) { - captureUnscopedValue( index, Catch::Detail::stringify( value ) ); - } - - template - void captureUnscopedValues( size_t index, T const& value, Ts const&... values ) { - captureUnscopedValue( index, Catch::Detail::stringify(value) ); - captureUnscopedValues( index+1, values... ); - } - void captureValue( size_t index, std::string const& value ); template @@ -98,10 +86,6 @@ namespace Catch { captureValue( index, Catch::Detail::stringify(value) ); captureValues( index+1, values... ); } - - std::vector getMessageDetails() const { - return m_messages; - } }; } // end namespace Catch @@ -119,7 +103,8 @@ namespace Catch { Catch::Capturer varName( macroName##_catch_sr, \ CATCH_INTERNAL_LINEINFO, \ Catch::ResultWas::Info, \ - #__VA_ARGS__##_catch_sr ); \ + #__VA_ARGS__##_catch_sr, \ + true ); \ varName.captureValues( 0, __VA_ARGS__ ) /////////////////////////////////////////////////////////////////////////////// @@ -127,8 +112,9 @@ namespace Catch { Catch::Capturer varName( macroName##_catch_sr, \ CATCH_INTERNAL_LINEINFO, \ Catch::ResultWas::Info, \ - #__VA_ARGS__##_catch_sr ); \ - varName.captureUnscopedValues( 0, __VA_ARGS__ ); + #__VA_ARGS__##_catch_sr, \ + false ); \ + varName.captureValues( 0, __VA_ARGS__ ); /////////////////////////////////////////////////////////////////////////////// #define INTERNAL_CATCH_INFO( macroName, log ) \ @@ -149,12 +135,11 @@ namespace Catch { #elif defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) - #define CATCH_INFO( msg ) (void)(0) - #define CATCH_UNSCOPED_INFO( msg ) (void)(0) - #define CATCH_WARN( msg ) (void)(0) - #define CATCH_CAPTURE( ... ) (void)(0) - #define CATCH_UNSCOPED_CAPTURE( ... ) (void)(0) - + #define CATCH_INFO( msg ) (void)(0) + #define CATCH_UNSCOPED_INFO( msg ) (void)(0) + #define CATCH_WARN( msg ) (void)(0) + #define CATCH_CAPTURE( ... ) (void)(0) + #define CATCH_UNSCOPED_CAPTURE( ... ) (void)(0) #elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && !defined(CATCH_CONFIG_DISABLE) @@ -167,12 +152,11 @@ namespace Catch { #elif !defined(CATCH_CONFIG_PREFIX_MESSAGES) && defined(CATCH_CONFIG_DISABLE) - #define INFO( msg ) (void)(0) - #define UNSCOPED_INFO( msg ) (void)(0) - #define WARN( msg ) (void)(0) - #define CAPTURE( ... ) (void)(0) - #define UNSCOPED_CAPTURE( ... ) (void)(0) - + #define INFO(msg) (void)(0) + #define UNSCOPED_INFO(msg) (void)(0) + #define WARN(msg) (void)(0) + #define CAPTURE(...) (void)(0) + #define UNSCOPED_CAPTURE(...) (void)(0) #endif // end of user facing macro declarations diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt index ae9433b4b6..2dfa1cb302 100644 --- a/tests/SelfTest/Baselines/compact.sw.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.approved.txt @@ -2194,8 +2194,8 @@ MatchersRanges.tests.cpp:: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } -Message.tests.cpp:: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' -Message.tests.cpp:: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' +Message.tests.cpp:: passed: with 7 messages: '1' and '2' and '3' and '3' and '3' and 'true' and 'true' +Message.tests.cpp:: passed: with 11 messages: '"escaped, ", "' and '"single quote in string,',"' and '"some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<"' and ''"'' and ''''' and '','' and ''}'' and '')'' and ''('' and ''{'' Exception.tests.cpp:: failed: unexpected exception with message: '3.14000000000000012' UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 @@ -2722,9 +2722,9 @@ Skip.tests.cpp:: skipped: 'skipping because answer = 43' StringManip.tests.cpp:: passed: splitStringRef("", ','), Equals(std::vector()) for: { } Equals: { } StringManip.tests.cpp:: passed: splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } StringManip.tests.cpp:: passed: splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } -Message.tests.cpp:: failed: false with 1 message: 'input := { 7, 8, 9 }' -Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' -Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' +Message.tests.cpp:: failed: false with 1 message: '{ 7, 8, 9 }' +Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..."' and '1' and '2' and '3' +Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..."' and '4' and '5' and '6' Message.tests.cpp:: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' Message.tests.cpp:: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' StringManip.tests.cpp:: passed: !(startsWith("", 'c')) for: !false @@ -2889,12 +2889,7 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: -<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected -======= -test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected -assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt index 6a6da732da..7491f920c5 100644 --- a/tests/SelfTest/Baselines/compact.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/compact.sw.multi.approved.txt @@ -2187,8 +2187,8 @@ MatchersRanges.tests.cpp:: passed: a, !RangeEquals( b ) for: { 1, 2 MatchersRanges.tests.cpp:: passed: a, UnorderedRangeEquals( b ) for: { 1, 2, 3 } unordered elements are { 3, 2, 1 } MatchersRanges.tests.cpp:: passed: vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } elements are { 2, 3, 4 } MatchersRanges.tests.cpp:: passed: vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } -Message.tests.cpp:: passed: with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' -Message.tests.cpp:: passed: with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' +Message.tests.cpp:: passed: with 7 messages: '1' and '2' and '3' and '3' and '3' and 'true' and 'true' +Message.tests.cpp:: passed: with 11 messages: '"escaped, ", "' and '"single quote in string,',"' and '"some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<"' and ''"'' and ''''' and '','' and ''}'' and '')'' and ''('' and ''{'' Exception.tests.cpp:: failed: unexpected exception with message: '3.14000000000000012' UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 UniquePtr.tests.cpp:: passed: bptr->i == 3 for: 3 == 3 @@ -2711,9 +2711,9 @@ Skip.tests.cpp:: skipped: 'skipping because answer = 43' StringManip.tests.cpp:: passed: splitStringRef("", ','), Equals(std::vector()) for: { } Equals: { } StringManip.tests.cpp:: passed: splitStringRef("abc", ','), Equals(std::vector{"abc"}) for: { abc } Equals: { abc } StringManip.tests.cpp:: passed: splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } -Message.tests.cpp:: failed: false with 1 message: 'input := { 7, 8, 9 }' -Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' -Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' +Message.tests.cpp:: failed: false with 1 message: '{ 7, 8, 9 }' +Message.tests.cpp:: failed: false with 4 messages: '"Count 1 to 3..."' and '1' and '2' and '3' +Message.tests.cpp:: failed: false with 4 messages: '"Count 4 to 6..."' and '4' and '5' and '6' Message.tests.cpp:: failed: false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' Message.tests.cpp:: failed: false with 4 messages: 'Count 4 to 6...' and '4' and '5' and '6' StringManip.tests.cpp:: passed: !(startsWith("", 'c')) for: !false @@ -2878,12 +2878,7 @@ InternalBenchmark.tests.cpp:: passed: med == 18. for: 18.0 == 18.0 InternalBenchmark.tests.cpp:: passed: q3 == 23. for: 23.0 == 23.0 Misc.tests.cpp:: passed: Misc.tests.cpp:: passed: -<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected -======= -test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected -assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.std.approved.txt b/tests/SelfTest/Baselines/console.std.approved.txt index b83a603ed6..1f36082f9f 100644 --- a/tests/SelfTest/Baselines/console.std.approved.txt +++ b/tests/SelfTest/Baselines/console.std.approved.txt @@ -1687,7 +1687,7 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with message: - input := { 7, 8, 9 } + { 7, 8, 9 } ------------------------------------------------------------------------------- stacks unscoped capture in loops @@ -1698,18 +1698,18 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 1 to 3..." := "Count 1 to 3..." - input := 1 - input := 2 - input := 3 + "Count 1 to 3..." + 1 + 2 + 3 Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 4 to 6..." := "Count 4 to 6..." - input := 4 - input := 5 - input := 6 + "Count 4 to 6..." + 4 + 5 + 6 ------------------------------------------------------------------------------- stacks unscoped info in loops @@ -1752,11 +1752,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -<<<<<<< HEAD test cases: 439 | 337 passed | 78 failed | 7 skipped | 17 failed as expected assertions: 2283 | 2103 passed | 139 failed | 41 failed as expected -======= -test cases: 438 | 336 passed | 78 failed | 7 skipped | 17 failed as expected -assertions: 2276 | 2096 passed | 139 failed | 41 failed as expected ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt index 488630258e..8390d91f17 100644 --- a/tests/SelfTest/Baselines/console.sw.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.approved.txt @@ -14240,13 +14240,13 @@ Message.tests.cpp: Message.tests.cpp:: PASSED: with messages: - a := 1 - b := 2 - c := 3 - a + b := 3 - a+b := 3 - c > b := true - a == 1 := true + 1 + 2 + 3 + 3 + 3 + true + true ------------------------------------------------------------------------------- UNSCOPED_CAPTURE parses string and character constants @@ -14256,18 +14256,17 @@ Message.tests.cpp: Message.tests.cpp:: PASSED: with messages: - ("comma, in string", "escaped, \", ") := "escaped, ", " - "single quote in string,'," := "single quote in string,'," - "some escapes, \\,\\\\" := "some escapes, \,\\" - "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[ - <" - '"' := '"' - '\'' := ''' - ',' := ',' - '}' := '}' - ')' := ')' - '(' := '(' - '{' := '{' + "escaped, ", " + "single quote in string,'," + "some escapes, \,\\" + "some, ), unmatched, } prenheses {[<" + '"' + ''' + ',' + '}' + ')' + '(' + '{' ------------------------------------------------------------------------------- Unexpected exceptions can be translated @@ -18163,7 +18162,7 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with message: - input := { 7, 8, 9 } + { 7, 8, 9 } ------------------------------------------------------------------------------- stacks unscoped capture in loops @@ -18174,18 +18173,18 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 1 to 3..." := "Count 1 to 3..." - input := 1 - input := 2 - input := 3 + "Count 1 to 3..." + 1 + 2 + 3 Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 4 to 6..." := "Count 4 to 6..." - input := 4 - input := 5 - input := 6 + "Count 4 to 6..." + 4 + 5 + 6 ------------------------------------------------------------------------------- stacks unscoped info in loops @@ -19337,11 +19336,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected -======= -test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected -assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/console.sw.multi.approved.txt b/tests/SelfTest/Baselines/console.sw.multi.approved.txt index 3b446dffb3..7a6ea12b21 100644 --- a/tests/SelfTest/Baselines/console.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/console.sw.multi.approved.txt @@ -14233,13 +14233,13 @@ Message.tests.cpp: Message.tests.cpp:: PASSED: with messages: - a := 1 - b := 2 - c := 3 - a + b := 3 - a+b := 3 - c > b := true - a == 1 := true + 1 + 2 + 3 + 3 + 3 + true + true ------------------------------------------------------------------------------- UNSCOPED_CAPTURE parses string and character constants @@ -14249,18 +14249,17 @@ Message.tests.cpp: Message.tests.cpp:: PASSED: with messages: - ("comma, in string", "escaped, \", ") := "escaped, ", " - "single quote in string,'," := "single quote in string,'," - "some escapes, \\,\\\\" := "some escapes, \,\\" - "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[ - <" - '"' := '"' - '\'' := ''' - ',' := ',' - '}' := '}' - ')' := ')' - '(' := '(' - '{' := '{' + "escaped, ", " + "single quote in string,'," + "some escapes, \,\\" + "some, ), unmatched, } prenheses {[<" + '"' + ''' + ',' + '}' + ')' + '(' + '{' ------------------------------------------------------------------------------- Unexpected exceptions can be translated @@ -18152,7 +18151,7 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with message: - input := { 7, 8, 9 } + { 7, 8, 9 } ------------------------------------------------------------------------------- stacks unscoped capture in loops @@ -18163,18 +18162,18 @@ Message.tests.cpp: Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 1 to 3..." := "Count 1 to 3..." - input := 1 - input := 2 - input := 3 + "Count 1 to 3..." + 1 + 2 + 3 Message.tests.cpp:: FAILED: CHECK( false ) with messages: - "Count 4 to 6..." := "Count 4 to 6..." - input := 4 - input := 5 - input := 6 + "Count 4 to 6..." + 4 + 5 + 6 ------------------------------------------------------------------------------- stacks unscoped info in loops @@ -19326,11 +19325,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -<<<<<<< HEAD test cases: 439 | 319 passed | 97 failed | 6 skipped | 17 failed as expected assertions: 2304 | 2103 passed | 160 failed | 41 failed as expected -======= -test cases: 438 | 318 passed | 97 failed | 6 skipped | 17 failed as expected -assertions: 2297 | 2096 passed | 160 failed | 41 failed as expected ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/junit.sw.approved.txt b/tests/SelfTest/Baselines/junit.sw.approved.txt index 96bfe05a3f..3496927757 100644 --- a/tests/SelfTest/Baselines/junit.sw.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.approved.txt @@ -1,11 +1,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) @@ -2302,7 +2298,7 @@ at Skip.tests.cpp: FAILED: CHECK( false ) -input := { 7, 8, 9 } +{ 7, 8, 9 } at Message.tests.cpp: @@ -2310,19 +2306,19 @@ at Message.tests.cpp: FAILED: CHECK( false ) -"Count 1 to 3..." := "Count 1 to 3..." -input := 1 -input := 2 -input := 3 +"Count 1 to 3..." +1 +2 +3 at Message.tests.cpp: FAILED: CHECK( false ) -"Count 4 to 6..." := "Count 4 to 6..." -input := 4 -input := 5 -input := 6 +"Count 4 to 6..." +4 +5 +6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt index 26335ff3e1..20fea80b4f 100644 --- a/tests/SelfTest/Baselines/junit.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/junit.sw.multi.approved.txt @@ -1,10 +1,6 @@ -<<<<<<< HEAD -======= - ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) @@ -2301,7 +2297,7 @@ at Skip.tests.cpp: FAILED: CHECK( false ) -input := { 7, 8, 9 } +{ 7, 8, 9 } at Message.tests.cpp: @@ -2309,19 +2305,19 @@ at Message.tests.cpp: FAILED: CHECK( false ) -"Count 1 to 3..." := "Count 1 to 3..." -input := 1 -input := 2 -input := 3 +"Count 1 to 3..." +1 +2 +3 at Message.tests.cpp: FAILED: CHECK( false ) -"Count 4 to 6..." := "Count 4 to 6..." -input := 4 -input := 5 -input := 6 +"Count 4 to 6..." +4 +5 +6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt index de252bfafd..13e8dbecb6 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -1880,7 +1880,7 @@ at Message.tests.cpp: FAILED: CHECK( false ) -input := { 7, 8, 9 } +{ 7, 8, 9 } at Message.tests.cpp: @@ -1888,19 +1888,19 @@ at Message.tests.cpp: FAILED: CHECK( false ) -"Count 1 to 3..." := "Count 1 to 3..." -input := 1 -input := 2 -input := 3 +"Count 1 to 3..." +1 +2 +3 at Message.tests.cpp: FAILED: CHECK( false ) -"Count 4 to 6..." := "Count 4 to 6..." -input := 4 -input := 5 -input := 6 +"Count 4 to 6..." +4 +5 +6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt index f99cdb7d8f..9d61b0d4ad 100644 --- a/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/sonarqube.sw.multi.approved.txt @@ -1879,7 +1879,7 @@ at Message.tests.cpp: FAILED: CHECK( false ) -input := { 7, 8, 9 } +{ 7, 8, 9 } at Message.tests.cpp: @@ -1887,19 +1887,19 @@ at Message.tests.cpp: FAILED: CHECK( false ) -"Count 1 to 3..." := "Count 1 to 3..." -input := 1 -input := 2 -input := 3 +"Count 1 to 3..." +1 +2 +3 at Message.tests.cpp: FAILED: CHECK( false ) -"Count 4 to 6..." := "Count 4 to 6..." -input := 4 -input := 5 -input := 6 +"Count 4 to 6..." +4 +5 +6 at Message.tests.cpp: diff --git a/tests/SelfTest/Baselines/tap.sw.approved.txt b/tests/SelfTest/Baselines/tap.sw.approved.txt index 8974c639f3..7282bf7c12 100644 --- a/tests/SelfTest/Baselines/tap.sw.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.approved.txt @@ -3396,9 +3396,9 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } # UNSCOPED CAPTURE can deal with complex expressions -ok {test-number} - with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +ok {test-number} - with 7 messages: '1' and '2' and '3' and '3' and '3' and 'true' and 'true' # UNSCOPED_CAPTURE parses string and character constants -ok {test-number} - with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' +ok {test-number} - with 11 messages: '"escaped, ", "' and '"single quote in string,',"' and '"some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<"' and ''"'' and ''''' and '','' and ''}'' and '')'' and ''('' and ''{'' # Unexpected exceptions can be translated not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions @@ -4368,11 +4368,11 @@ ok {test-number} - splitStringRef("abc", ','), Equals(std::vector{"ab # splitString ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } # stacks unscoped capture for vector -not ok {test-number} - false with 1 message: 'input := { 7, 8, 9 }' +not ok {test-number} - false with 1 message: '{ 7, 8, 9 }' # stacks unscoped capture in loops -not ok {test-number} - false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +not ok {test-number} - false with 4 messages: '"Count 1 to 3..."' and '1' and '2' and '3' # stacks unscoped capture in loops -not ok {test-number} - false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' +not ok {test-number} - false with 4 messages: '"Count 4 to 6..."' and '4' and '5' and '6' # stacks unscoped info in loops not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' # stacks unscoped info in loops @@ -4629,9 +4629,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -<<<<<<< HEAD 1..2316 -======= -1..2309 ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt index 776a466338..7231067303 100644 --- a/tests/SelfTest/Baselines/tap.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/tap.sw.multi.approved.txt @@ -3389,9 +3389,9 @@ ok {test-number} - vector_a, RangeEquals( array_a_plus_1, close_enough ) for: { # Type conversions of RangeEquals and similar ok {test-number} - vector_a, UnorderedRangeEquals( array_a_plus_1, close_enough ) for: { 1, 2, 3 } unordered elements are { 2, 3, 4 } # UNSCOPED CAPTURE can deal with complex expressions -ok {test-number} - with 7 messages: 'a := 1' and 'b := 2' and 'c := 3' and 'a + b := 3' and 'a+b := 3' and 'c > b := true' and 'a == 1 := true' +ok {test-number} - with 7 messages: '1' and '2' and '3' and '3' and '3' and 'true' and 'true' # UNSCOPED_CAPTURE parses string and character constants -ok {test-number} - with 11 messages: '("comma, in string", "escaped, \", ") := "escaped, ", "' and '"single quote in string,'," := "single quote in string,',"' and '"some escapes, \\,\\\\" := "some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<"' and ''"' := '"'' and ''\'' := '''' and '',' := ','' and ''}' := '}'' and '')' := ')'' and ''(' := '('' and ''{' := '{'' +ok {test-number} - with 11 messages: '"escaped, ", "' and '"single quote in string,',"' and '"some escapes, \,\\"' and '"some, ), unmatched, } prenheses {[<"' and ''"'' and ''''' and '','' and ''}'' and '')'' and ''('' and ''{'' # Unexpected exceptions can be translated not ok {test-number} - unexpected exception with message: '3.14000000000000012' # Upcasting special member functions @@ -4357,11 +4357,11 @@ ok {test-number} - splitStringRef("abc", ','), Equals(std::vector{"ab # splitString ok {test-number} - splitStringRef("abc,def", ','), Equals(std::vector{"abc", "def"}) for: { abc, def } Equals: { abc, def } # stacks unscoped capture for vector -not ok {test-number} - false with 1 message: 'input := { 7, 8, 9 }' +not ok {test-number} - false with 1 message: '{ 7, 8, 9 }' # stacks unscoped capture in loops -not ok {test-number} - false with 4 messages: '"Count 1 to 3..." := "Count 1 to 3..."' and 'input := 1' and 'input := 2' and 'input := 3' +not ok {test-number} - false with 4 messages: '"Count 1 to 3..."' and '1' and '2' and '3' # stacks unscoped capture in loops -not ok {test-number} - false with 4 messages: '"Count 4 to 6..." := "Count 4 to 6..."' and 'input := 4' and 'input := 5' and 'input := 6' +not ok {test-number} - false with 4 messages: '"Count 4 to 6..."' and '4' and '5' and '6' # stacks unscoped info in loops not ok {test-number} - false with 4 messages: 'Count 1 to 3...' and '1' and '2' and '3' # stacks unscoped info in loops @@ -4618,9 +4618,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0 ok {test-number} - # xmlentitycheck ok {test-number} - -<<<<<<< HEAD 1..2316 -======= -1..2309 ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/teamcity.sw.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.approved.txt index d7e95a4c02..eea630607e 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.approved.txt @@ -970,11 +970,11 @@ loose text artifact ##teamcity[testStarted name='splitString'] ##teamcity[testFinished name='splitString' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped capture for vector'] -##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "input := { 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "{ 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFinished name='stacks unscoped capture for vector' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped capture in loops'] -##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3..." := "Count 1 to 3...""|n "input := 1"|n "input := 2"|n "input := 3"|n CHECK( false )|nwith expansion:|n false|n'] -##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6..." := "Count 4 to 6...""|n "input := 4"|n "input := 5"|n "input := 6"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3...""|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6...""|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFinished name='stacks unscoped capture in loops' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped info in loops'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] diff --git a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt index 96d2c0cfa3..690833f732 100644 --- a/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/teamcity.sw.multi.approved.txt @@ -969,11 +969,11 @@ ##teamcity[testStarted name='splitString'] ##teamcity[testFinished name='splitString' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped capture for vector'] -##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "input := { 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture for vector' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with message:|n "{ 7, 8, 9 }"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFinished name='stacks unscoped capture for vector' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped capture in loops'] -##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3..." := "Count 1 to 3...""|n "input := 1"|n "input := 2"|n "input := 3"|n CHECK( false )|nwith expansion:|n false|n'] -##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6..." := "Count 4 to 6...""|n "input := 4"|n "input := 5"|n "input := 6"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n ""Count 1 to 3...""|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] +##teamcity[testFailed name='stacks unscoped capture in loops' message='Message.tests.cpp:|nexpression failed with messages:|n ""Count 4 to 6...""|n "4"|n "5"|n "6"|n CHECK( false )|nwith expansion:|n false|n'] ##teamcity[testFinished name='stacks unscoped capture in loops' duration="{duration}"] ##teamcity[testStarted name='stacks unscoped info in loops'] ##teamcity[testFailed name='stacks unscoped info in loops' message='Message.tests.cpp:|n...............................................................................|n|nMessage.tests.cpp:|nexpression failed with messages:|n "Count 1 to 3..."|n "1"|n "2"|n "3"|n CHECK( false )|nwith expansion:|n false|n'] diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt index 1cd0a2a4db..5a2892e565 100644 --- a/tests/SelfTest/Baselines/xml.sw.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.approved.txt @@ -16450,61 +16450,61 @@ There is no extra whitespace here - a := 1 + 1 - b := 2 + 2 - c := 3 + 3 - a + b := 3 + 3 - a+b := 3 + 3 - c > b := true + true - a == 1 := true + true - ("comma, in string", "escaped, \", ") := "escaped, ", " + "escaped, ", " - "single quote in string,'," := "single quote in string,'," + "single quote in string,'," - "some escapes, \\,\\\\" := "some escapes, \,\\" + "some escapes, \,\\" - "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" + "some, ), unmatched, } prenheses {[<" - '"' := '"' + '"' - '\'' := ''' + ''' - ',' := ',' + ',' - '}' := '}' + '}' - ')' := ')' + ')' - '(' := '(' + '(' - '{' := '{' + '{' @@ -21082,7 +21082,7 @@ Approx( -1.95996398454005449 ) - input := { 7, 8, 9 } + { 7, 8, 9 } @@ -21096,16 +21096,16 @@ Approx( -1.95996398454005449 ) - "Count 1 to 3..." := "Count 1 to 3..." + "Count 1 to 3..." - input := 1 + 1 - input := 2 + 2 - input := 3 + 3 @@ -21116,16 +21116,16 @@ Approx( -1.95996398454005449 ) - "Count 4 to 6..." := "Count 4 to 6..." + "Count 4 to 6..." - input := 4 + 4 - input := 5 + 5 - input := 6 + 6 @@ -22403,11 +22403,6 @@ Approx( -1.95996398454005449 ) -<<<<<<< HEAD -======= - - ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt index a186e525b3..6d111b1d5f 100644 --- a/tests/SelfTest/Baselines/xml.sw.multi.approved.txt +++ b/tests/SelfTest/Baselines/xml.sw.multi.approved.txt @@ -16450,61 +16450,61 @@ There is no extra whitespace here - a := 1 + 1 - b := 2 + 2 - c := 3 + 3 - a + b := 3 + 3 - a+b := 3 + 3 - c > b := true + true - a == 1 := true + true - ("comma, in string", "escaped, \", ") := "escaped, ", " + "escaped, ", " - "single quote in string,'," := "single quote in string,'," + "single quote in string,'," - "some escapes, \\,\\\\" := "some escapes, \,\\" + "some escapes, \,\\" - "some, ), unmatched, } prenheses {[<" := "some, ), unmatched, } prenheses {[<" + "some, ), unmatched, } prenheses {[<" - '"' := '"' + '"' - '\'' := ''' + ''' - ',' := ',' + ',' - '}' := '}' + '}' - ')' := ')' + ')' - '(' := '(' + '(' - '{' := '{' + '{' @@ -21081,7 +21081,7 @@ Approx( -1.95996398454005449 ) - input := { 7, 8, 9 } + { 7, 8, 9 } @@ -21095,16 +21095,16 @@ Approx( -1.95996398454005449 ) - "Count 1 to 3..." := "Count 1 to 3..." + "Count 1 to 3..." - input := 1 + 1 - input := 2 + 2 - input := 3 + 3 @@ -21115,16 +21115,16 @@ Approx( -1.95996398454005449 ) - "Count 4 to 6..." := "Count 4 to 6..." + "Count 4 to 6..." - input := 4 + 4 - input := 5 + 5 - input := 6 + 6 @@ -22402,11 +22402,6 @@ Approx( -1.95996398454005449 ) -<<<<<<< HEAD -======= - - ->>>>>>> abfdfcf0 (Editing Baseline Files to Accomodate tests for UNSCOPED CAPTURE) diff --git a/tests/SelfTest/UsageTests/Message.tests.cpp b/tests/SelfTest/UsageTests/Message.tests.cpp index 1dbc33c921..a552a6727d 100644 --- a/tests/SelfTest/UsageTests/Message.tests.cpp +++ b/tests/SelfTest/UsageTests/Message.tests.cpp @@ -238,7 +238,7 @@ TEST_CASE( "stacks unscoped capture in loops", "[failing][.][unscoped][capture]" TEST_CASE( "stacks unscoped capture for vector", "[failing][.][unscoped][capture]" ) { { std::vector vec { 7, 8, 9 }; - unscoped_capture( vec); + unscoped_capture( vec ); } CHECK( false ); }