diff options
| author | Martin Jeřábek | 2024-03-01 11:15:27 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2024-03-01 21:24:45 +0100 |
| commit | cde35096641d55b4aa0f743bb03e04703fbb5e9c (patch) | |
| tree | 7072371d7a380dcac9142a4ef8e701756e3fbcd2 /src/catch2/catch_tostring.cpp | |
| parent | 7677c1658eb4417ec60649589610bf4e3d731bc9 (diff) | |
| download | catch3-cde35096641d55b4aa0f743bb03e04703fbb5e9c.tar.gz | |
Fix various useful clang-tidy warnings
* bugprone-branch-clone
* bugprone-copy-constructor-init
* bugprone-empty-catch
* bugprone-sizeof-expression
* bugprone-switch-missing-default-case
* bugprone-unused-local-non-trivial-variable
* clang-analyzer-core.uninitialized.Assign
* clang-analyzer-cplusplus.Move
* clang-analyzer-optin.cplusplus.VirtualCall
* modernize-loop-convert
* modernize-raw-string-literal
* modernize-use-equals-default
* modernize-use-override
* modernize-use-using
* performance-avoid-endl
* performance-inefficient-string-concatenation
* performance-inefficient-vector-operation
* performance-noexcept-move-constructor
* performance-unnecessary-value-param (and improve generator example)
* readability-duplicate-include
* readability-inconsistent-declaration-parameter-name
* readability-non-const-parameter
* readability-redundant-casting
* readability-redundant-member-init
* readability-redundant-smartptr-get
* readability-static-accessed-through-instance
* unused variable in amalgamted tests
Diffstat (limited to 'src/catch2/catch_tostring.cpp')
| -rw-r--r-- | src/catch2/catch_tostring.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/catch2/catch_tostring.cpp b/src/catch2/catch_tostring.cpp index b97cf560..b0b53c5e 100644 --- a/src/catch2/catch_tostring.cpp +++ b/src/catch2/catch_tostring.cpp @@ -54,13 +54,13 @@ namespace Detail { } } // end unnamed namespace - std::string convertIntoString(StringRef string, bool escape_invisibles) { + std::string convertIntoString(StringRef string, bool escapeInvisibles) { std::string ret; // This is enough for the "don't escape invisibles" case, and a good // lower bound on the "escape invisibles" case. ret.reserve(string.size() + 2); - if (!escape_invisibles) { + if (!escapeInvisibles) { ret += '"'; ret += string; ret += '"'; @@ -138,7 +138,7 @@ std::string StringMaker<char const*>::convert(char const* str) { return{ "{null string}" }; } } -std::string StringMaker<char*>::convert(char* str) { +std::string StringMaker<char*>::convert(char* str) { // NOLINT(readability-non-const-parameter) if (str) { return Detail::convertIntoString( str ); } else { @@ -235,8 +235,8 @@ std::string StringMaker<signed char>::convert(signed char value) { std::string StringMaker<char>::convert(char c) { return ::Catch::Detail::stringify(static_cast<signed char>(c)); } -std::string StringMaker<unsigned char>::convert(unsigned char c) { - return ::Catch::Detail::stringify(static_cast<char>(c)); +std::string StringMaker<unsigned char>::convert(unsigned char value) { + return ::Catch::Detail::stringify(static_cast<char>(value)); } int StringMaker<float>::precision = 5; |