hashkit: fix murmur3 activation
authorMichael Wallner <mike@php.net>
Mon, 6 Jan 2020 12:28:44 +0000 (13:28 +0100)
committerMichael Wallner <mike@php.net>
Mon, 6 Jan 2020 12:45:01 +0000 (13:45 +0100)
libhashkit/function.cc
tests/hashkit_functions.cc

index bee87ff78a263b6557581f4adecfff1b2b440fcd..e6891a0fb026e6fb207364f9acb846b925f003f5 100644 (file)
@@ -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))
     {
index 3301c7a1e4b0d9a8eee794f155a9cdab58384fd4..59c53809c1e065360417643087cf20c697bceb0d 100644 (file)
@@ -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");
     }
   }