summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/common/api_test.hpp
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/execution_api/common/api_test.hpp
parentdd15af0ba4b22348e38d535aadc9fa5e929f3824 (diff)
downloadjustbuild-5fb67de531fead44123ff30ee5cf37340fc63a0b.tar.gz
Use TestHashType in tests
...instead of calling ProtocolTraits::IsCompatible
Diffstat (limited to 'test/buildtool/execution_api/common/api_test.hpp')
-rw-r--r--test/buildtool/execution_api/common/api_test.hpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/test/buildtool/execution_api/common/api_test.hpp b/test/buildtool/execution_api/common/api_test.hpp
index 3c4052b3..4b84d66a 100644
--- a/test/buildtool/execution_api/common/api_test.hpp
+++ b/test/buildtool/execution_api/common/api_test.hpp
@@ -25,7 +25,6 @@
#include "catch2/catch_test_macros.hpp"
#include "src/buildtool/common/artifact_description.hpp"
#include "src/buildtool/common/artifact_digest_factory.hpp"
-#include "src/buildtool/common/protocol_traits.hpp"
#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/common/execution_action.hpp"
#include "src/buildtool/execution_api/common/execution_api.hpp"
@@ -34,6 +33,7 @@
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/logging/logger.hpp"
+#include "test/utils/hermeticity/test_hash_function_type.hpp"
using ApiFactory = std::function<IExecutionApi::Ptr()>;
using ExecProps = std::map<std::string, std::string>;
@@ -140,9 +140,7 @@ using ExecProps = std::map<std::string, std::string>;
bool is_hermetic = false) {
std::string test_content("test");
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
auto test_digest = ArtifactDigestFactory::HashDataAs<ObjectType::File>(
hash_function, test_content);
@@ -224,9 +222,7 @@ using ExecProps = std::map<std::string, std::string>;
bool is_hermetic = false) {
std::string test_content("test");
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
auto test_digest = ArtifactDigestFactory::HashDataAs<ObjectType::File>(
hash_function, test_content);
@@ -315,9 +311,7 @@ using ExecProps = std::map<std::string, std::string>;
ExecProps const& props) {
std::string test_content("test");
- HashFunction const hash_function{ProtocolTraits::Instance().IsCompatible()
- ? HashFunction::Type::PlainSHA256
- : HashFunction::Type::GitSHA1};
+ HashFunction const hash_function{TestHashType::ReadFromEnvironment()};
auto test_digest = ArtifactDigestFactory::HashDataAs<ObjectType::File>(
hash_function, test_content);