From ce23db59c6399199fa55b4b7dc8880522e2f1bca Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Mon, 30 Sep 2024 12:16:43 +0200 Subject: Enable readability-redundant-member-init check. --- .../build_engine/expression/linked_map.test.cpp | 4 ++-- .../execution_engine/executor/executor.test.cpp | 4 ++-- .../execution_engine/traverser/traverser.test.cpp | 16 ++++++++-------- test/buildtool/graph_traverser/graph_traverser.test.hpp | 8 ++++---- test/buildtool/logging/logger.test.cpp | 4 ++-- test/buildtool/multithreading/task_system.test.cpp | 4 ++-- 6 files changed, 20 insertions(+), 20 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 4d0bf993..f6c3bd58 100644 --- a/test/buildtool/build_engine/expression/linked_map.test.cpp +++ b/test/buildtool/build_engine/expression/linked_map.test.cpp @@ -113,7 +113,7 @@ class CopyCounter { private: // all copies of this object share the same counter - std::shared_ptr count_{}; + std::shared_ptr count_; }; TEST_CASE("Zero copies", "[linked_map]") { @@ -218,7 +218,7 @@ class CustomContainer { [[nodiscard]] auto Map() & noexcept -> linked_map_t& { return map_; } private: - linked_map_t map_{}; + linked_map_t map_; }; TEST_CASE("Custom NextPtr", "[linked_map]") { diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 7eeee78f..59b06648 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -52,7 +52,7 @@ struct TestApiConfig { struct TestExecutionConfig { bool failed{}; - std::vector outputs{}; + std::vector outputs; }; struct TestResponseConfig { @@ -60,7 +60,7 @@ struct TestApiConfig { int exit_code{}; }; - std::unordered_map artifacts{}; + std::unordered_map artifacts; TestExecutionConfig execution; TestResponseConfig response; }; diff --git a/test/buildtool/execution_engine/traverser/traverser.test.cpp b/test/buildtool/execution_engine/traverser/traverser.test.cpp index 3fb57871..a6fb2c85 100644 --- a/test/buildtool/execution_engine/traverser/traverser.test.cpp +++ b/test/buildtool/execution_engine/traverser/traverser.test.cpp @@ -95,11 +95,11 @@ class TestBuildInfo { } private: - std::unordered_set correctly_built_{}; - std::unordered_set incorrectly_built_{}; - std::unordered_set artifacts_uploaded_{}; - std::unordered_set uploaded_more_than_once_{}; - std::string name_{}; + std::unordered_set correctly_built_; + std::unordered_set incorrectly_built_; + std::unordered_set artifacts_uploaded_; + std::unordered_set uploaded_more_than_once_; + std::string name_; std::mutex mutex_; }; @@ -218,9 +218,9 @@ class TestProject { } private: - std::vector graph_full_description_{}; - std::unordered_set artifacts_to_be_built_{}; - std::unordered_set local_artifacts_{}; + std::vector graph_full_description_; + std::unordered_set artifacts_to_be_built_; + std::unordered_set local_artifacts_; }; } // namespace diff --git a/test/buildtool/graph_traverser/graph_traverser.test.hpp b/test/buildtool/graph_traverser/graph_traverser.test.hpp index cb9cb57c..a9839638 100644 --- a/test/buildtool/graph_traverser/graph_traverser.test.hpp +++ b/test/buildtool/graph_traverser/graph_traverser.test.hpp @@ -56,8 +56,8 @@ class TestProject { public: struct CommandLineArguments { GraphTraverser::CommandLineArguments gtargs; - nlohmann::json artifacts{}; - std::filesystem::path graph_description{}; + nlohmann::json artifacts; + std::filesystem::path graph_description; explicit CommandLineArguments( GraphTraverser::CommandLineArguments gtargs) @@ -111,8 +111,8 @@ class TestProject { "test/buildtool/graph_traverser/data/"; static inline std::string const kDefaultEntryPointsFileName = "_entry_points"; - std::string example_name_{}; - std::filesystem::path root_dir_{}; + std::string example_name_; + std::filesystem::path root_dir_; RepositoryConfig repo_config_{}; void SetupConfig() { diff --git a/test/buildtool/logging/logger.test.cpp b/test/buildtool/logging/logger.test.cpp index 474a656f..e0abd13a 100644 --- a/test/buildtool/logging/logger.test.cpp +++ b/test/buildtool/logging/logger.test.cpp @@ -27,8 +27,8 @@ // Stores prints from test sink instances class TestPrints { struct PrintData { - std::atomic counter{}; - std::unordered_map> prints{}; + std::atomic counter; + std::unordered_map> prints; }; public: diff --git a/test/buildtool/multithreading/task_system.test.cpp b/test/buildtool/multithreading/task_system.test.cpp index fb6bbd1f..36b1cc14 100644 --- a/test/buildtool/multithreading/task_system.test.cpp +++ b/test/buildtool/multithreading/task_system.test.cpp @@ -92,10 +92,10 @@ TEST_CASE("Side effects of tasks are reflected out of ts", "[task_system]") { SECTION("Lambda capturing `this` inside struct") { std::string ext_name{}; struct Wrapper { - std::string name{}; + std::string name; // ts must be second, otherwise name will get destroyed before the // task system is finished. - TaskSystem ts{}; + TaskSystem ts; explicit Wrapper(std::string n) : name{std::move(n)} {} -- cgit v1.2.3