diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-12 14:28:13 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-09-13 14:41:00 +0200 |
commit | 5fb67de531fead44123ff30ee5cf37340fc63a0b (patch) | |
tree | 0e1c7c8810e8ee311467e5e07ebb8ff2902adf28 /test/buildtool/common/action_description.test.cpp | |
parent | dd15af0ba4b22348e38d535aadc9fa5e929f3824 (diff) | |
download | justbuild-5fb67de531fead44123ff30ee5cf37340fc63a0b.tar.gz |
Use TestHashType in tests
...instead of calling ProtocolTraits::IsCompatible
Diffstat (limited to 'test/buildtool/common/action_description.test.cpp')
-rw-r--r-- | test/buildtool/common/action_description.test.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/test/buildtool/common/action_description.test.cpp b/test/buildtool/common/action_description.test.cpp index 504f6aa3..65f5d92e 100644 --- a/test/buildtool/common/action_description.test.cpp +++ b/test/buildtool/common/action_description.test.cpp @@ -20,14 +20,8 @@ #include "nlohmann/json.hpp" #include "src/buildtool/common/action.hpp" #include "src/buildtool/common/artifact_description.hpp" -#include "src/buildtool/common/protocol_traits.hpp" #include "src/buildtool/crypto/hash_function.hpp" - -[[nodiscard]] static inline auto GetHashType(bool compatible) noexcept - -> HashFunction::Type { - return compatible ? HashFunction::Type::PlainSHA256 - : HashFunction::Type::GitSHA1; -} +#include "test/utils/hermeticity/test_hash_function_type.hpp" TEST_CASE("From JSON", "[action_description]") { using path = std::filesystem::path; @@ -45,8 +39,7 @@ TEST_CASE("From JSON", "[action_description]") { desc.Inputs()} .ToJson(); - auto const hash_type = - GetHashType(ProtocolTraits::Instance().IsCompatible()); + auto const hash_type = TestHashType::ReadFromEnvironment(); SECTION("Parse full action") { auto description = ActionDescription::FromJson(hash_type, "id", json); REQUIRE(description); |