X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhashkit_functions.c;h=2990b2331e1739e124414b291920c42ff54e6687;hb=04bbb4383e54d431a3513045dad4be62b91c64af;hp=1302011e76f48f14ad49f362bcf51c42f85bad09;hpb=dec0636927f5d0ae4cf06ad2710d022990419879;p=m6w6%2Flibmemcached diff --git a/tests/hashkit_functions.c b/tests/hashkit_functions.c index 1302011e..2990b233 100644 --- a/tests/hashkit_functions.c +++ b/tests/hashkit_functions.c @@ -249,6 +249,9 @@ static test_return_t hsieh_run (hashkit_st *hashk __attribute__((unused))) static test_return_t murmur_run (hashkit_st *hashk __attribute__((unused))) { +#ifdef __sparc + return TEST_SKIPPED; +#else uint32_t x; const char **ptr; @@ -261,6 +264,7 @@ static test_return_t murmur_run (hashkit_st *hashk __attribute__((unused))) } return TEST_SUCCESS; +#endif } static test_return_t jenkins_run (hashkit_st *hashk __attribute__((unused))) @@ -325,21 +329,41 @@ collection_st collection[] ={ }; /* Prototypes for functions we will pass to test framework */ -void *world_create(void); +void *world_create(test_return_t *error); test_return_t world_destroy(hashkit_st *hashk); -void *world_create(void) +void *world_create(test_return_t *error) { hashkit_st *hashk_ptr; hashk_ptr= hashkit_create(&global_hashk); - assert(hashk_ptr == &global_hashk); + if (hashk_ptr != &global_hashk) + { + *error= TEST_FAILURE; + return NULL; + } // First we test if hashk is even valid - assert(hashkit_is_initialized(hashk_ptr) == true); - assert(hashkit_is_allocated(hashk_ptr) == false); - assert(hashk_ptr->continuum == NULL); + if (hashkit_is_initialized(hashk_ptr) == false) + { + *error= TEST_FAILURE; + return NULL; + } + + if (hashkit_is_allocated(hashk_ptr) == true) + { + *error= TEST_FAILURE; + return NULL; + } + + if (hashk_ptr->continuum != NULL) + { + *error= TEST_FAILURE; + return NULL; + } + + *error= TEST_SUCCESS; return hashk_ptr; }