summaryrefslogtreecommitdiff
path: root/test/buildtool/storage/large_object_cas.test.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-09-12 14:28:13 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-09-13 14:41:00 +0200
commit5fb67de531fead44123ff30ee5cf37340fc63a0b (patch)
tree0e1c7c8810e8ee311467e5e07ebb8ff2902adf28 /test/buildtool/storage/large_object_cas.test.cpp
parentdd15af0ba4b22348e38d535aadc9fa5e929f3824 (diff)
downloadjustbuild-5fb67de531fead44123ff30ee5cf37340fc63a0b.tar.gz
Use TestHashType in tests
...instead of calling ProtocolTraits::IsCompatible
Diffstat (limited to 'test/buildtool/storage/large_object_cas.test.cpp')
-rw-r--r--test/buildtool/storage/large_object_cas.test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/buildtool/storage/large_object_cas.test.cpp b/test/buildtool/storage/large_object_cas.test.cpp
index cbc92038..e0e3c816 100644
--- a/test/buildtool/storage/large_object_cas.test.cpp
+++ b/test/buildtool/storage/large_object_cas.test.cpp
@@ -405,7 +405,8 @@ static void TestExternal(StorageConfig const& storage_config,
REQUIRE(FileSystemManager::IsFile(path));
}
- if (kIsTree and not ProtocolTraits::Instance().IsCompatible()) {
+ if (kIsTree and ProtocolTraits::IsTreeAllowed(
+ storage_config.hash_function.GetType())) {
// Tree invariants check is omitted in compatible mode.
SECTION("Tree invariants check fails") {
// Check splice fails due to the tree invariants check.
@@ -606,7 +607,8 @@ TEST_CASE("LargeObjectCAS: uplink nested large objects", "[storage]") {
// However, in native mode they might be reconstructed on request because
// their entries are in the latest generation:
- if (not ProtocolTraits::Instance().IsCompatible()) {
+ if (ProtocolTraits::IsNative(
+ storage_config.Get().hash_function.GetType())) {
auto split_nested_tree_2 = latest.CAS().SplitTree(*nested_tree_digest);
REQUIRE(split_nested_tree_2);
@@ -720,10 +722,10 @@ auto Tree::StoreRaw(LocalCAS<kDefaultDoGlobalUplink> const& cas,
return cas.StoreBlob(content);
};
- return ProtocolTraits::Instance().IsCompatible()
- ? BazelMsgFactory::CreateDirectoryDigestFromLocalTree(
+ return ProtocolTraits::IsNative(cas.GetHashFunction().GetType())
+ ? BazelMsgFactory::CreateGitTreeDigestFromLocalTree(
directory, store_blob, store_tree, store_symlink)
- : BazelMsgFactory::CreateGitTreeDigestFromLocalTree(
+ : BazelMsgFactory::CreateDirectoryDigestFromLocalTree(
directory, store_blob, store_tree, store_symlink);
}
} // namespace LargeTestUtils