summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/bazel/bazel_network.test.cpp
diff options
context:
space:
mode:
authorSascha Roloff <sascha.roloff@huawei.com>2022-10-13 11:39:13 +0200
committerSascha Roloff <sascha.roloff@huawei.com>2022-10-14 12:46:42 +0200
commitf7e4ebf0e2913ff1b987e40baab5c0c809e6c0de (patch)
tree09ae121b46743a7eb682d9ba1361a59566c558bc /test/buildtool/execution_api/bazel/bazel_network.test.cpp
parent4d53961509015534fa10a59f4b86a20ae8a66017 (diff)
downloadjustbuild-f7e4ebf0e2913ff1b987e40baab5c0c809e6c0de.tar.gz
Remove default value of ArtifactDigest::Create template parameter
This enforces the explicit specification, which object type, either file or tree, should be used to create an artifact digest. This also avoids subtile errors at locations as in the previous commit, where files as well as trees are supposed to be handled, but digest creation mistakenly defaults to file object type.
Diffstat (limited to 'test/buildtool/execution_api/bazel/bazel_network.test.cpp')
-rw-r--r--test/buildtool/execution_api/bazel/bazel_network.test.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/buildtool/execution_api/bazel/bazel_network.test.cpp b/test/buildtool/execution_api/bazel/bazel_network.test.cpp
index 6d58d463..ccfcd695 100644
--- a/test/buildtool/execution_api/bazel/bazel_network.test.cpp
+++ b/test/buildtool/execution_api/bazel/bazel_network.test.cpp
@@ -30,9 +30,12 @@ TEST_CASE("Bazel network: write/read blobs", "[execution_api]") {
std::string content_bar("bar");
std::string content_baz(kLargeSize, 'x'); // single larger blob
- BazelBlob foo{ArtifactDigest::Create(content_foo), content_foo};
- BazelBlob bar{ArtifactDigest::Create(content_bar), content_bar};
- BazelBlob baz{ArtifactDigest::Create(content_baz), content_baz};
+ BazelBlob foo{ArtifactDigest::Create<ObjectType::File>(content_foo),
+ content_foo};
+ BazelBlob bar{ArtifactDigest::Create<ObjectType::File>(content_bar),
+ content_bar};
+ BazelBlob baz{ArtifactDigest::Create<ObjectType::File>(content_baz),
+ content_baz};
// Search blobs via digest
REQUIRE(network.UploadBlobs(BlobContainer{{foo, bar, baz}}));
@@ -71,8 +74,10 @@ TEST_CASE("Bazel network: read blobs with unknown size", "[execution_api]") {
std::string content_foo("foo");
std::string content_bar(kLargeSize, 'x'); // single larger blob
- BazelBlob foo{ArtifactDigest::Create(content_foo), content_foo};
- BazelBlob bar{ArtifactDigest::Create(content_bar), content_bar};
+ BazelBlob foo{ArtifactDigest::Create<ObjectType::File>(content_foo),
+ content_foo};
+ BazelBlob bar{ArtifactDigest::Create<ObjectType::File>(content_bar),
+ content_bar};
// Upload blobs
REQUIRE(network.UploadBlobs(BlobContainer{{foo, bar}}));