Updates, rpm now tests the install locations.
[m6w6/libmemcached] / tests / hashkit_functions.c
index fd6185a1a50461d726c4b8e96513d3f4a837534d..2990b2331e1739e124414b291920c42ff54e6687 100644 (file)
@@ -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;
 }