From dc1db0e8b43f5e907a3ded2e39da8b58fa50a04b Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Wed, 18 Sep 2024 17:51:41 +0200 Subject: Store HashFunction by const reference. Despite the fact that HashFunction is a small type, it still makes sense to store it by reference to reflect the ownership. StorageConfig becomes the main holder. Reference holders store HashFunction by const ref and aren't allowed to change it. However, they are free to return HashFunction by value since this doesn't benefit readability anyhow. --- .../execution_engine/executor/executor.test.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/buildtool/execution_engine/executor/executor.test.cpp') diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index e2d62342..46ad743e 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -325,7 +325,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -343,7 +343,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -361,7 +361,7 @@ TEST_CASE("Executor: Process artifact", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -408,7 +408,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -429,7 +429,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -450,7 +450,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -474,7 +474,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -495,7 +495,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, @@ -519,7 +519,7 @@ TEST_CASE("Executor: Process action", "[executor]") { auto api = TestApi::Ptr{new TestApi{config}}; Statistics stats{}; Progress progress{}; - auto const apis = CreateTestApiBundle(hash_function, api); + auto const apis = CreateTestApiBundle(&hash_function, api); ExecutionContext const exec_context{.repo_config = &repo_config, .apis = &apis, .remote_context = &remote_context, -- cgit v1.2.3