From 6ea993a98a635f979dbe31c28363654709d5f63f Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 6 Jan 2020 13:28:44 +0100 Subject: [PATCH] hashkit: fix murmur3 activation --- libhashkit/function.cc | 6 ++++++ tests/hashkit_functions.cc | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libhashkit/function.cc b/libhashkit/function.cc index bee87ff7..e6891a0f 100644 --- a/libhashkit/function.cc +++ b/libhashkit/function.cc @@ -58,6 +58,12 @@ static hashkit_return_t _set_function(struct hashkit_st::hashkit_function_st *se return HASHKIT_INVALID_ARGUMENT; case HASHKIT_HASH_MURMUR3: + if (libhashkit_has_algorithm(HASHKIT_HASH_MURMUR3)) + { + self->function= hashkit_murmur3; + break; + } + return HASHKIT_INVALID_ARGUMENT; case HASHKIT_HASH_MURMUR: if (libhashkit_has_algorithm(HASHKIT_HASH_MURMUR)) { diff --git a/tests/hashkit_functions.cc b/tests/hashkit_functions.cc index 3301c7a1..59c53809 100644 --- a/tests/hashkit_functions.cc +++ b/tests/hashkit_functions.cc @@ -396,6 +396,10 @@ static test_return_t hashkit_set_function_test(hashkit_st *hashk) list= murmur_values; break; + case HASHKIT_HASH_MURMUR3: + list= murmur3_values; + break; + case HASHKIT_HASH_JENKINS: list= jenkins_values; break; @@ -418,7 +422,7 @@ static test_return_t hashkit_set_function_test(hashkit_st *hashk) } else { - return TEST_FAILURE; + test_fail("Unknown algorithm"); } } -- 2.30.2