diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-21 16:18:47 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-02-27 09:03:30 +0100 |
commit | a8a167cb206f6c66e52ab4e92e0939e91b8dfed8 (patch) | |
tree | 7861406725739f45a98c1312ed45264bb10b9b35 /test/buildtool/execution_api/bazel/bazel_network.test.cpp | |
parent | e1880bead60d433de2960104bd62cd9e27bfca17 (diff) | |
download | justbuild-a8a167cb206f6c66e52ab4e92e0939e91b8dfed8.tar.gz |
ArtifactBlob: Convert to a class
Diffstat (limited to 'test/buildtool/execution_api/bazel/bazel_network.test.cpp')
-rw-r--r-- | test/buildtool/execution_api/bazel/bazel_network.test.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
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<ArtifactDigest> to_read{ - foo.digest, bar.digest, baz.digest, bar.digest, foo.digest}; + std::vector<ArtifactDigest> to_read{foo.GetDigest(), + bar.GetDigest(), + baz.GetDigest(), + bar.GetDigest(), + foo.GetDigest()}; std::vector<ArtifactBlob> 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<ArtifactDigest> to_read{foo.digest, bar.digest}; + std::vector<ArtifactDigest> to_read{foo.GetDigest(), bar.GetDigest()}; std::vector<ArtifactBlob> 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); } |