diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-01-29 09:46:58 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-07 14:58:04 +0100 |
commit | 95792fb717bd84d500037b62c77a4949274e670d (patch) | |
tree | 9bb1765a57e4d6d42941a33aff7e9721dec8068e /test | |
parent | ea2291d24d531a1ea221f1035636303ac0da787d (diff) | |
download | justbuild-95792fb717bd84d500037b62c77a4949274e670d.tar.gz |
Replace ArtifactBlobContainer and BazelBlobContainer
...with explicit std::unordered_set.
Diffstat (limited to 'test')
5 files changed, 13 insertions, 13 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp index 13840c4b..de366c18 100644 --- a/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_msg_factory.test.cpp @@ -20,6 +20,7 @@ #include <optional> #include <string> #include <unordered_map> +#include <unordered_set> #include <utility> #include <vector> @@ -116,7 +117,7 @@ TEST_CASE("Bazel internals: MessageFactory", "[execution_api]") { {link_blob->digest, link}}; // create blobs via tree - ArtifactBlobContainer blobs{}; + std::unordered_set<ArtifactBlob> blobs{}; REQUIRE(BazelMsgFactory::CreateDirectoryDigestFromTree( *tree, [&fake_cas](std::vector<ArtifactDigest> const& digests, diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp index fcb90634..5cfedef1 100644 --- a/test/buildtool/execution_api/common/api_test.hpp +++ b/test/buildtool/execution_api/common/api_test.hpp @@ -24,6 +24,7 @@ #include <optional> #include <string> #include <unordered_map> +#include <unordered_set> #include <utility> #include <vector> @@ -253,9 +254,8 @@ using ExecProps = std::map<std::string, std::string>; std::string output_path{"output_file"}; auto api = api_factory(); - CHECK(api->Upload(ArtifactBlobContainer{{ArtifactBlob{ - test_digest, test_content, /*is_exec=*/false}}}, - false)); + CHECK(api->Upload( + {ArtifactBlob{test_digest, test_content, /*is_exec=*/false}}, false)); auto action = api->CreateAction(*api->UploadTree({{input_path, &input_artifact}}), diff --git a/test/buildtool/execution_api/local/local_execution.test.cpp b/test/buildtool/execution_api/local/local_execution.test.cpp index dff30d51..4c5565e1 100644 --- a/test/buildtool/execution_api/local/local_execution.test.cpp +++ b/test/buildtool/execution_api/local/local_execution.test.cpp @@ -20,6 +20,7 @@ #include <optional> #include <string> #include <unordered_map> +#include <unordered_set> #include <utility> #include <vector> @@ -274,9 +275,8 @@ TEST_CASE("LocalExecution: One input copied to output", "[execution_api]") { std::string test_content("test"); auto test_digest = ArtifactDigestFactory::HashDataAs<ObjectType::File>( storage_config.Get().hash_function, test_content); - REQUIRE(api.Upload(ArtifactBlobContainer{{ArtifactBlob{ - test_digest, test_content, /*is_exec=*/false}}}, - false)); + REQUIRE(api.Upload( + {ArtifactBlob{test_digest, test_content, /*is_exec=*/false}}, false)); std::string input_path{"dir/subdir/input"}; std::string output_path{"output_file"}; diff --git a/test/buildtool/execution_engine/executor/executor.test.cpp b/test/buildtool/execution_engine/executor/executor.test.cpp index 834a63ca..531e8301 100644 --- a/test/buildtool/execution_engine/executor/executor.test.cpp +++ b/test/buildtool/execution_engine/executor/executor.test.cpp @@ -220,7 +220,7 @@ class TestApi : public IExecutionApi { -> std::optional<std::string> override { return std::nullopt; // not needed by Executor } - [[nodiscard]] auto Upload(ArtifactBlobContainer&& blobs, + [[nodiscard]] auto Upload(std::unordered_set<ArtifactBlob>&& blobs, bool /*unused*/) const noexcept -> bool final { return std::all_of( blobs.begin(), blobs.end(), [this](auto const& blob) { diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp index b61b66d3..dc3e98e4 100644 --- a/test/buildtool/execution_engine/executor/executor_api.test.hpp +++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp @@ -71,11 +71,11 @@ static inline void RunBlobUpload(RepositoryConfig* repo_config, HashFunction const hash_function{TestHashType::ReadFromEnvironment()}; std::string const blob = "test"; - CHECK(api->Upload(ArtifactBlobContainer{ + CHECK(api->Upload( {ArtifactBlob{ArtifactDigestFactory::HashDataAs<ObjectType::File>( hash_function, blob), blob, - /*is_exec=*/false}}})); + /*is_exec=*/false}})); } [[nodiscard]] static inline auto GetTestDir() -> std::filesystem::path { @@ -437,9 +437,8 @@ static inline void TestUploadAndDownloadTrees( // upload blobs auto api = factory(); - REQUIRE(api->Upload(ArtifactBlobContainer{ - {ArtifactBlob{foo_digest, foo, /*is_exec=*/false}, - ArtifactBlob{bar_digest, bar, /*is_exec=*/false}}})); + REQUIRE(api->Upload({ArtifactBlob{foo_digest, foo, /*is_exec=*/false}, + ArtifactBlob{bar_digest, bar, /*is_exec=*/false}})); // define known artifacts auto foo_desc = |