summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-05-27 16:16:26 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-05-28 16:19:19 +0200
commitc0b46b2f4e47fc017beeae34ff555418d198e1d4 (patch)
tree6a4319a1b974fd6113fab80dd1047c1a8cb7be18 /test/buildtool/execution_api/bazel/bytestream_client.test.cpp
parentfd8ad0f561dd253bf7399ce9a4594242e918ca25 (diff)
downloadjustbuild-c0b46b2f4e47fc017beeae34ff555418d198e1d4.tar.gz
Use shared_ptr for data in ContentBlob
...to reduce the "price" of copying.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bytestream_client.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bytestream_client.test.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
index 285ec7d7..fea6edea 100644
--- a/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
+++ b/test/buildtool/execution_api/bazel/bytestream_client.test.cpp
@@ -130,7 +130,7 @@ TEST_CASE("ByteStream Client: Transfer multiple blobs", "[execution_api]") {
blob.digest.hash(),
blob.digest.size_bytes());
},
- [](auto const& blob) { return blob.data; }));
+ [](auto const& blob) { return *blob.data; }));
SECTION("Download small blobs") {
std::vector<std::string> contents{};
@@ -146,9 +146,9 @@ TEST_CASE("ByteStream Client: Transfer multiple blobs", "[execution_api]") {
contents.emplace_back(std::move(data));
});
REQUIRE(contents.size() == 3);
- CHECK(contents[0] == foo.data);
- CHECK(contents[1] == bar.data);
- CHECK(contents[2] == baz.data);
+ CHECK(contents[0] == *foo.data);
+ CHECK(contents[1] == *bar.data);
+ CHECK(contents[2] == *baz.data);
}
}
@@ -183,7 +183,7 @@ TEST_CASE("ByteStream Client: Transfer multiple blobs", "[execution_api]") {
blob.digest.hash(),
blob.digest.size_bytes());
},
- [](auto const& blob) { return blob.data; }));
+ [](auto const& blob) { return *blob.data; }));
SECTION("Download large blobs") {
std::vector<std::string> contents{};
@@ -199,9 +199,9 @@ TEST_CASE("ByteStream Client: Transfer multiple blobs", "[execution_api]") {
contents.emplace_back(std::move(data));
});
REQUIRE(contents.size() == 3);
- CHECK(contents[0] == foo.data);
- CHECK(contents[1] == bar.data);
- CHECK(contents[2] == baz.data);
+ CHECK(contents[0] == *foo.data);
+ CHECK(contents[1] == *bar.data);
+ CHECK(contents[2] == *baz.data);
}
}
}