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 /tests/ExtraTests | |
| 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 'tests/ExtraTests')
| -rw-r--r-- | tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp | 2 | ||||
| -rw-r--r-- | tests/ExtraTests/X29-CustomArgumentsForReporters.cpp | 1 | ||||
| -rw-r--r-- | tests/ExtraTests/X91-AmalgamatedCatch.cpp | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp b/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp index af03ce30..33399a68 100644 --- a/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp +++ b/tests/ExtraTests/X22-BenchmarksInCumulativeReporter.cpp @@ -34,7 +34,7 @@ public: return "Custom reporter for testing cumulative reporter base"; } - virtual void testRunEndedCumulative() override; + void testRunEndedCumulative() override; }; CATCH_REGISTER_REPORTER("testReporter", CumulativeBenchmarkReporter) diff --git a/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp index 9bd816ef..13d9fc18 100644 --- a/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp +++ b/tests/ExtraTests/X29-CustomArgumentsForReporters.cpp @@ -36,6 +36,7 @@ public: void testRunStarting( Catch::TestRunInfo const& ) override { std::vector<std::pair<std::string, std::string>> options; + options.reserve( m_customOptions.size() ); for ( auto const& kv : m_customOptions ) { options.push_back( kv ); } diff --git a/tests/ExtraTests/X91-AmalgamatedCatch.cpp b/tests/ExtraTests/X91-AmalgamatedCatch.cpp index c00462be..78d45a2c 100644 --- a/tests/ExtraTests/X91-AmalgamatedCatch.cpp +++ b/tests/ExtraTests/X91-AmalgamatedCatch.cpp @@ -16,10 +16,10 @@ TEST_CASE("Just a dummy test") { auto i = GENERATE(1, 2, 3); SECTION("a") { - REQUIRE(1 != 4); + REQUIRE(i != 4); } SECTION("b") { - CHECK(1 != 5); + CHECK(i != 5); } REQUIRE_THAT(1, Catch::Matchers::Predicate<int>([](int i) { |