diff options
| author | Martin Hořeňovský | 2021-10-03 10:09:10 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-10-03 10:37:30 +0200 |
| commit | 928e198ef289c2c259ad0d6ee2b3741c3a2b185a (patch) | |
| tree | ca967e39913a873207123686860c2195dca48fc7 /src/catch2/internal | |
| parent | 3e9c6fec222a5b307a712ba47dc4e930b37ad4e5 (diff) | |
| download | catch3-928e198ef289c2c259ad0d6ee2b3741c3a2b185a.tar.gz | |
Demote some single character strings into plain chars
Diffstat (limited to 'src/catch2/internal')
| -rw-r--r-- | src/catch2/internal/catch_clara.cpp | 2 | ||||
| -rw-r--r-- | src/catch2/internal/catch_combined_tu.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/internal/catch_commandline.cpp | 8 | ||||
| -rw-r--r-- | src/catch2/internal/catch_stream.cpp | 4 | ||||
| -rw-r--r-- | src/catch2/internal/catch_template_test_registry.hpp | 4 | ||||
| -rw-r--r-- | src/catch2/internal/catch_xmlwriter.cpp | 2 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp index eb7dacae..df844838 100644 --- a/src/catch2/internal/catch_clara.cpp +++ b/src/catch2/internal/catch_clara.cpp @@ -113,7 +113,7 @@ namespace Catch { } else { return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + - source + "'" ); + source + '\'' ); } return ParserResult::ok( ParseResultType::Matched ); } diff --git a/src/catch2/internal/catch_combined_tu.cpp b/src/catch2/internal/catch_combined_tu.cpp index b78d1904..601ac8e7 100644 --- a/src/catch2/internal/catch_combined_tu.cpp +++ b/src/catch2/internal/catch_combined_tu.cpp @@ -221,11 +221,11 @@ namespace Catch { auto operator << (std::ostream& os, LazyExpression const& lazyExpr) -> std::ostream& { if (lazyExpr.m_isNegated) - os << "!"; + os << '!'; if (lazyExpr) { if (lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression()) - os << "(" << *lazyExpr.m_transientExpression << ")"; + os << '(' << *lazyExpr.m_transientExpression << ')'; else os << *lazyExpr.m_transientExpression; } else { diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp index 0cb160e0..103e7344 100644 --- a/src/catch2/internal/catch_commandline.cpp +++ b/src/catch2/internal/catch_commandline.cpp @@ -34,14 +34,14 @@ namespace Catch { }(); if (warningSet == WarnAbout::Nothing) - return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" ); + return ParserResult::runtimeError( "Unrecognised warning: '" + warning + '\'' ); config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet ); return ParserResult::ok( ParseResultType::Matched ); }; auto const loadTestNamesFromFile = [&]( std::string const& filename ) { std::ifstream f( filename.c_str() ); if( !f.is_open() ) - return ParserResult::runtimeError( "Unable to load input file: '" + filename + "'" ); + return ParserResult::runtimeError( "Unable to load input file: '" + filename + '\'' ); std::string line; while( std::getline( f, line ) ) { @@ -67,7 +67,7 @@ namespace Catch { else if( startsWith( "random", order ) ) config.runOrder = TestRunOrder::Randomized; else - return ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" ); + return ParserResult::runtimeError( "Unrecognised ordering: '" + order + '\'' ); return ParserResult::ok( ParseResultType::Matched ); }; auto const setRngSeed = [&]( std::string const& seed ) { @@ -112,7 +112,7 @@ namespace Catch { else if( lcVerbosity == "high" ) config.verbosity = Verbosity::High; else - return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" ); + return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + '\'' ); return ParserResult::ok( ParseResultType::Matched ); }; auto const setReporter = [&]( std::string const& reporter ) { diff --git a/src/catch2/internal/catch_stream.cpp b/src/catch2/internal/catch_stream.cpp index 9890ae3a..745c6a2d 100644 --- a/src/catch2/internal/catch_stream.cpp +++ b/src/catch2/internal/catch_stream.cpp @@ -78,7 +78,7 @@ namespace Detail { public: FileStream( std::string const& filename ) { m_ofs.open( filename.c_str() ); - CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" ); + CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' ); } ~FileStream() override = default; public: // IStream @@ -130,7 +130,7 @@ namespace Detail { if( filename == "%debug" ) return Detail::make_unique<Detail::DebugOutStream>(); else - CATCH_ERROR( "Unrecognised stream: '" << filename << "'" ); + CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' ); } else return Detail::make_unique<Detail::FileStream>( filename ); diff --git a/src/catch2/internal/catch_template_test_registry.hpp b/src/catch2/internal/catch_template_test_registry.hpp index 1099f9db..235ee3e4 100644 --- a/src/catch2/internal/catch_template_test_registry.hpp +++ b/src/catch2/internal/catch_template_test_registry.hpp @@ -133,7 +133,7 @@ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */\ } \ }; \ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \ @@ -264,7 +264,7 @@ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\ - (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \ + (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */ \ }\ };\ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\ diff --git a/src/catch2/internal/catch_xmlwriter.cpp b/src/catch2/internal/catch_xmlwriter.cpp index 3aecd04a..24af491a 100644 --- a/src/catch2/internal/catch_xmlwriter.cpp +++ b/src/catch2/internal/catch_xmlwriter.cpp @@ -268,7 +268,7 @@ namespace { if (shouldIndent(fmt)) { m_os << m_indent; } - m_os << "</" << m_tags.back() << ">"; + m_os << "</" << m_tags.back() << '>'; } m_os << std::flush; applyFormatting(fmt); |