From a8a167cb206f6c66e52ab4e92e0939e91b8dfed8 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 21 Feb 2025 16:18:47 +0100 Subject: ArtifactBlob: Convert to a class --- .../execution_api/bazel/bazel_network.test.cpp | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'test/buildtool/execution_api/bazel/bazel_network.test.cpp') diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp index 47ddee6c..1bc6c0ac 100644 --- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp +++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp @@ -87,8 +87,11 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { // Read blobs in order auto reader = network.CreateReader(); - std::vector to_read{ - foo.digest, bar.digest, baz.digest, bar.digest, foo.digest}; + std::vector to_read{foo.GetDigest(), + bar.GetDigest(), + baz.GetDigest(), + bar.GetDigest(), + foo.GetDigest()}; std::vector blobs{}; for (auto next : reader.ReadIncrementally(&to_read)) { blobs.insert(blobs.end(), next.begin(), next.end()); @@ -96,11 +99,11 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") { // Check order maintained REQUIRE(blobs.size() == 5); - CHECK(*blobs[0].data == content_foo); - CHECK(*blobs[1].data == content_bar); - CHECK(*blobs[2].data == content_baz); - CHECK(*blobs[3].data == content_bar); - CHECK(*blobs[4].data == content_foo); + CHECK(*blobs[0].ReadContent() == content_foo); + CHECK(*blobs[1].ReadContent() == content_bar); + CHECK(*blobs[2].ReadContent() == content_baz); + CHECK(*blobs[3].ReadContent() == content_bar); + CHECK(*blobs[4].ReadContent() == content_foo); } TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { @@ -149,7 +152,7 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { // Read blobs auto reader = network.CreateReader(); - std::vector to_read{foo.digest, bar.digest}; + std::vector to_read{foo.GetDigest(), bar.GetDigest()}; std::vector blobs{}; for (auto next : reader.ReadIncrementally(&to_read)) { blobs.insert(blobs.end(), next.begin(), next.end()); @@ -157,6 +160,6 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") { // Check order maintained REQUIRE(blobs.size() == 2); - CHECK(*blobs[0].data == content_foo); - CHECK(*blobs[1].data == content_bar); + CHECK(*blobs[0].ReadContent() == content_foo); + CHECK(*blobs[1].ReadContent() == content_bar); } -- cgit v1.2.3