summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-10-04 13:52:55 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-10-07 17:51:22 +0200
commit6d484db9b293aac4b8bd790eb7aead3a806f8c7b (patch)
treec7a93cef8a95006f217d557300151ce5e8735437 /test
parent0fc0d9118b5e525fa582de0286c8e83bb0da4e16 (diff)
downloadjustbuild-6d484db9b293aac4b8bd790eb7aead3a806f8c7b.tar.gz
Enable cppcoreguidelines-* checks.
Diffstat (limited to 'test')
-rw-r--r--test/buildtool/build_engine/expression/linked_map.test.cpp3
-rw-r--r--test/buildtool/execution_engine/traverser/traverser.test.cpp1
-rw-r--r--test/buildtool/logging/logger.test.cpp2
3 files changed, 3 insertions, 3 deletions
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<std::size_t>()} {}
- 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 <typename Container>
+ // 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>(); };
}
- LogSinkTest() noexcept { id_ = TestPrints::GetId(); }
+ LogSinkTest() noexcept : id_{TestPrints::GetId()} {}
void Emit(Logger const* logger,
LogLevel level,