X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fhashkit_functions.c;h=2990b2331e1739e124414b291920c42ff54e6687;hb=f6b4c8b2322df7ef8b0e430c3a951e41242fe14a;hp=fd6185a1a50461d726c4b8e96513d3f4a837534d;hpb=474deb0826ebcd7b748e15dd7f0fc6da0f64cd89;p=m6w6%2Flibmemcached diff --git a/tests/hashkit_functions.c b/tests/hashkit_functions.c index fd6185a1..2990b233 100644 --- a/tests/hashkit_functions.c +++ b/tests/hashkit_functions.c @@ -329,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; }