X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhashkit_functions.c;h=23feb9e50a6f3e46459684fb0a9196d07081359a;hb=da3714e6dc31ab2f9d115707ab79a838420c7b5a;hp=53c94b59c3eb3dbde9313d97da396039b16fc91e;hpb=6c2bd52dfa24287c856b0b679270b7f7681333a5;p=awesomized%2Flibmemcached diff --git a/tests/hashkit_functions.c b/tests/hashkit_functions.c index 53c94b59..23feb9e5 100644 --- a/tests/hashkit_functions.c +++ b/tests/hashkit_functions.c @@ -15,7 +15,7 @@ #include -#include "test.h" +#include #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,13 +335,20 @@ 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) + if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM) continue; - test_true(rc == HASHKIT_SUCCESS); + test_true_got(rc == HASHKIT_SUCCESS, hashkit_strerror(NULL, rc)); switch (algo) { @@ -436,7 +448,7 @@ static test_return_t hashkit_set_distribution_function_test(hashkit_st *hashk) if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_HSIEH) continue; - if (rc == HASHKIT_FAILURE && algo == HASHKIT_HASH_CUSTOM) + if (rc == HASHKIT_INVALID_ARGUMENT && algo == HASHKIT_HASH_CUSTOM) continue; test_true(rc == HASHKIT_SUCCESS);