Move testing framework out to its own library.
[m6w6/libmemcached] / tests / hashkit_functions.c
index 53c94b59c3eb3dbde9313d97da396039b16fc91e..0f2c42a99d050cd3c20954cb6d77cf6058274b03 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <libhashkit/hashkit.h>
 
-#include "test.h"
+#include <libtest/test.h>
 
 #include "hash_results.h"
 
@@ -262,6 +262,7 @@ static test_return_t murmur_run (hashkit_st *hashk)
   (void)hashk;
 
 #ifdef WORDS_BIGENDIAN
+  (void)murmur_values;
   return TEST_SKIPPED;
 #else
   uint32_t x;
@@ -271,7 +272,11 @@ static test_return_t murmur_run (hashkit_st *hashk)
   {
     uint32_t hash_val;
 
+#ifdef HAVE_MURMUR_HASH
     hash_val= libhashkit_murmur(*ptr, strlen(*ptr));
+#else
+    hash_val= 1;
+#endif
     assert(murmur_values[x] == hash_val);
   }
 
@@ -330,8 +335,15 @@ static test_return_t hashkit_set_function_test(hashkit_st *hashk)
     rc= hashkit_set_function(hashk, algo);
 
     /* Hsieh is disabled most of the time for patent issues */
+#ifndef HAVE_HSIEH_HASH
     if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH)
       continue;
+#endif
+
+#ifndef HAVE_MURMUR_HASH
+    if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_MURMUR)
+      continue;
+#endif
 
     if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_CUSTOM)
       continue;