From 6d484db9b293aac4b8bd790eb7aead3a806f8c7b Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 4 Oct 2024 13:52:55 +0200 Subject: Enable cppcoreguidelines-* checks. --- test/buildtool/build_engine/expression/linked_map.test.cpp | 3 +-- test/buildtool/execution_engine/traverser/traverser.test.cpp | 1 + test/buildtool/logging/logger.test.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/buildtool/build_engine/expression/linked_map.test.cpp b/test/buildtool/build_engine/expression/linked_map.test.cpp index f6c3bd58..1a8ceff5 100644 --- a/test/buildtool/build_engine/expression/linked_map.test.cpp +++ b/test/buildtool/build_engine/expression/linked_map.test.cpp @@ -95,9 +95,8 @@ TEST_CASE("Lookup and iteration", "[linked_map]") { class CopyCounter { public: CopyCounter() : count_{std::make_shared()} {} - CopyCounter(CopyCounter const& other) { + CopyCounter(CopyCounter const& other) : count_{other.count_} { ++(*other.count_); - count_ = other.count_; } CopyCounter(CopyCounter&&) = default; ~CopyCounter() = default; diff --git a/test/buildtool/execution_engine/traverser/traverser.test.cpp b/test/buildtool/execution_engine/traverser/traverser.test.cpp index a6fb2c85..6bbafc03 100644 --- a/test/buildtool/execution_engine/traverser/traverser.test.cpp +++ b/test/buildtool/execution_engine/traverser/traverser.test.cpp @@ -156,6 +156,7 @@ class TestExecutor { TestBuildInfo* build_info_; template + // NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward) [[nodiscard]] auto AllAvailable(Container&& c) const noexcept -> bool { return std::all_of(std::begin(c), std::end(c), [](auto node) { return node->TraversalState()->IsAvailable(); diff --git a/test/buildtool/logging/logger.test.cpp b/test/buildtool/logging/logger.test.cpp index e0abd13a..deee7477 100644 --- a/test/buildtool/logging/logger.test.cpp +++ b/test/buildtool/logging/logger.test.cpp @@ -61,7 +61,7 @@ class LogSinkTest : public ILogSink { return [] { return std::make_shared(); }; } - LogSinkTest() noexcept { id_ = TestPrints::GetId(); } + LogSinkTest() noexcept : id_{TestPrints::GetId()} {} void Emit(Logger const* logger, LogLevel level, -- cgit v1.2.3