From: Michael Wallner Date: Mon, 6 Jan 2020 12:28:44 +0000 (+0100) Subject: hashkit: fix murmur3 activation X-Git-Tag: pre_cmake~81 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6ea993a98a635f979dbe31c28363654709d5f63f;p=awesomized%2Flibmemcached hashkit: fix murmur3 activation --- 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"); } }