summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_engine/executor
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-05 16:49:45 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-22 17:01:13 +0200
commitbeb3faa6956b9bfd58d4ea6644a9b2987409aaba (patch)
tree9a1edee40bfe335717eb856237372d50127367ac /test/buildtool/execution_engine/executor
parent30f2b4a215ebd4f9c0c491f41de6e8eb56ed3fdf (diff)
downloadjustbuild-beb3faa6956b9bfd58d4ea6644a9b2987409aaba.tar.gz
Use HashFunction functionality via Instance()
...to track changes during refactoring easier.
Diffstat (limited to 'test/buildtool/execution_engine/executor')
-rw-r--r--test/buildtool/execution_engine/executor/TARGETS1
-rw-r--r--test/buildtool/execution_engine/executor/executor_api.test.hpp24
2 files changed, 14 insertions, 11 deletions
diff --git a/test/buildtool/execution_engine/executor/TARGETS b/test/buildtool/execution_engine/executor/TARGETS
index f6640f01..59acfa43 100644
--- a/test/buildtool/execution_engine/executor/TARGETS
+++ b/test/buildtool/execution_engine/executor/TARGETS
@@ -12,6 +12,7 @@
, ["@", "src", "src/buildtool/execution_engine/executor", "executor"]
, ["@", "src", "src/buildtool/file_system", "file_system_manager"]
, ["@", "src", "src/buildtool/progress_reporting", "progress"]
+ , ["@", "src", "src/buildtool/crypto", "hash_function"]
, ["@", "catch2", "", "catch2"]
, ["@", "gsl", "", "gsl"]
, ["utils", "test_remote_config"]
diff --git a/test/buildtool/execution_engine/executor/executor_api.test.hpp b/test/buildtool/execution_engine/executor/executor_api.test.hpp
index e683f373..7009b075 100644
--- a/test/buildtool/execution_engine/executor/executor_api.test.hpp
+++ b/test/buildtool/execution_engine/executor/executor_api.test.hpp
@@ -29,6 +29,7 @@
#include "src/buildtool/common/remote/retry_config.hpp"
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/common/statistics.hpp"
+#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/execution_engine/dag/dag.hpp"
@@ -52,9 +53,10 @@ static inline void RunBlobUpload(RepositoryConfig* repo_config,
auto api = factory();
std::string const blob = "test";
CHECK(api->Upload(ArtifactBlobContainer{{ArtifactBlob{
- ArtifactDigest{HashFunction::ComputeBlobHash(blob).HexString(),
- blob.size(),
- /*is_tree=*/false},
+ ArtifactDigest{
+ HashFunction::Instance().ComputeBlobHash(blob).HexString(),
+ blob.size(),
+ /*is_tree=*/false},
blob,
/*is_exec=*/false}}}));
}
@@ -401,14 +403,14 @@ static inline void TestUploadAndDownloadTrees(
auto foo = std::string{"foo"};
auto bar = std::string{"bar"};
- auto foo_digest =
- ArtifactDigest{HashFunction::ComputeBlobHash(foo).HexString(),
- foo.size(),
- /*is_tree=*/false};
- auto bar_digest =
- ArtifactDigest{HashFunction::ComputeBlobHash(bar).HexString(),
- bar.size(),
- /*is_tree=*/false};
+ auto foo_digest = ArtifactDigest{
+ HashFunction::Instance().ComputeBlobHash(foo).HexString(),
+ foo.size(),
+ /*is_tree=*/false};
+ auto bar_digest = ArtifactDigest{
+ HashFunction::Instance().ComputeBlobHash(bar).HexString(),
+ bar.size(),
+ /*is_tree=*/false};
// upload blobs
auto api = factory();