summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-01-29 13:11:33 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-02-07 14:58:04 +0100
commitb22ee0740857dad1f24999953864150a4f6bbcc8 (patch)
treed168ad32ad89429680ae741e5953aa0330b590f5 /test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp
parent457deb47d814cd1eaa79fd7cdbbe4d341ce49b04 (diff)
downloadjustbuild-b22ee0740857dad1f24999953864150a4f6bbcc8.tar.gz
BazelCasClient: Drop iterators in BatchReadBlobs
Diffstat (limited to 'test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp
index fe244151..4054b32a 100644
--- a/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp
+++ b/test/buildtool/execution_api/bazel/bazel_cas_client.test.cpp
@@ -19,7 +19,6 @@
#include <optional>
#include <string>
#include <unordered_set>
-#include <vector>
#include "catch2/catch_test_macros.hpp"
#include "gsl/gsl"
@@ -72,12 +71,10 @@ TEST_CASE("Bazel internals: CAS Client", "[execution_api]") {
}
// Read blob
- std::vector<bazel_re::Digest> to_read{digest};
- auto blobs = cas_client.BatchReadBlobs(
- instance_name, to_read.begin(), to_read.end());
+ auto blobs = cas_client.BatchReadBlobs(instance_name, {digest});
REQUIRE(blobs.size() == 1);
- CHECK(std::equal_to<bazel_re::Digest>{}(blobs[0].digest, digest));
- CHECK(*blobs[0].data == content);
+ CHECK(std::equal_to<bazel_re::Digest>{}(blobs.begin()->digest, digest));
+ CHECK(*blobs.begin()->data == content);
}
SECTION("Invalid digest and blob") {
@@ -98,9 +95,7 @@ TEST_CASE("Bazel internals: CAS Client", "[execution_api]") {
CHECK(cas_client.BatchUpdateBlobs(instance_name, {faulty_blob}) == 0U);
// Read blob via faulty digest
- std::vector<bazel_re::Digest> to_read{faulty_digest};
- CHECK(cas_client
- .BatchReadBlobs(instance_name, to_read.begin(), to_read.end())
- .empty());
+ CHECK(
+ cas_client.BatchReadBlobs(instance_name, {faulty_digest}).empty());
}
}