X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhashkit_functions.c;h=46f53934d7d48fc71ff9f646847c1370aa5ef7ed;hb=fc9fadb245d27c1615501b91637d112a0a052c8e;hp=1d548f4abeaa29c78d79a24757d67ac57d5927db;hpb=dac48f2dbe34915755f8f4f7f88419f47dc9e27f;p=awesomized%2Flibmemcached diff --git a/tests/hashkit_functions.c b/tests/hashkit_functions.c index 1d548f4a..46f53934 100644 --- a/tests/hashkit_functions.c +++ b/tests/hashkit_functions.c @@ -6,6 +6,8 @@ * the COPYING file in the parent directory for full text. */ +#include "config.h" + #include #include #include @@ -248,7 +250,7 @@ static test_return_t hsieh_run (hashkit_st *hashk __attribute__((unused))) static test_return_t murmur_run (hashkit_st *hashk __attribute__((unused))) { -#ifdef __sparc +#ifdef WORDS_BIGENDIAN return TEST_SKIPPED; #else uint32_t x; @@ -361,16 +363,23 @@ static test_return_t hashkit_set_function_test(hashkit_st *hashk) case HASHKIT_HASH_MAX: default: list= NULL; - test_fail("We ended up on a non-existent hash"); + break; } // Now we make sure we did set the hash correctly. - for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) + if (list) { - uint32_t hash_val; + for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) + { + uint32_t hash_val; - hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr)); - test_true(list[x] == hash_val); + hash_val= hashkit_digest(hashk, *ptr, strlen(*ptr)); + test_true(list[x] == hash_val); + } + } + else + { + return TEST_FAILURE; } } @@ -460,6 +469,7 @@ static test_return_t hashkit_compare_test(hashkit_st *hashk) clone= hashkit_clone(NULL, hashk); test_true(hashkit_compare(clone, hashk)); + hashkit_free(clone); return TEST_SUCCESS; }