diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-19 12:44:47 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:01:13 +0200 |
commit | b2dff03c841f159b474f445eb558a4ee153b1741 (patch) | |
tree | 2892207a7f7a359769706a107b12faf809d9f180 /test | |
parent | 57388e7624c71762e6aac30f16809c467f96ca58 (diff) | |
download | justbuild-b2dff03c841f159b474f445eb558a4ee153b1741.tar.gz |
Pass HashFunction from StorageConfig to Storage
Diffstat (limited to 'test')
-rw-r--r-- | test/buildtool/file_system/TARGETS | 1 | ||||
-rw-r--r-- | test/buildtool/file_system/object_cas.test.cpp | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/test/buildtool/file_system/TARGETS b/test/buildtool/file_system/TARGETS index 333e2b7e..20a8c47f 100644 --- a/test/buildtool/file_system/TARGETS +++ b/test/buildtool/file_system/TARGETS @@ -20,7 +20,6 @@ , "private-deps": [ ["@", "catch2", "", "catch2"] , ["", "catch-main"] - , ["@", "src", "src/buildtool/crypto", "hash_function"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] , ["@", "src", "src/buildtool/file_system", "object_cas"] , ["@", "src", "src/buildtool/file_system", "object_type"] diff --git a/test/buildtool/file_system/object_cas.test.cpp b/test/buildtool/file_system/object_cas.test.cpp index df72d038..a8fd746b 100644 --- a/test/buildtool/file_system/object_cas.test.cpp +++ b/test/buildtool/file_system/object_cas.test.cpp @@ -18,7 +18,6 @@ #include "catch2/catch_test_macros.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/bazel_types.hpp" -#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/file_system/object_cas.hpp" #include "src/buildtool/file_system/object_type.hpp" @@ -31,10 +30,11 @@ TEST_CASE("ObjectCAS", "[file_system]") { std::string test_content{"test"}; auto test_digest = ArtifactDigest::Create<ObjectType::File>( - HashFunction::Instance(), test_content); + storage_config.Get().hash_function, test_content); SECTION("CAS for files") { - ObjectCAS<ObjectType::File> cas{gen_config.cas_f}; + ObjectCAS<ObjectType::File> cas{storage_config.Get().hash_function, + gen_config.cas_f}; CHECK(not cas.BlobPath(test_digest)); SECTION("Add blob from bytes and verify") { @@ -72,7 +72,8 @@ TEST_CASE("ObjectCAS", "[file_system]") { } SECTION("CAS for executables") { - ObjectCAS<ObjectType::Executable> cas{gen_config.cas_x}; + ObjectCAS<ObjectType::Executable> cas{ + storage_config.Get().hash_function, gen_config.cas_x}; CHECK(not cas.BlobPath(test_digest)); SECTION("Add blob from bytes and verify") { |