Merged trunk.
[awesomized/libmemcached] / tests / atomsmasher.c
index 3b4879df4bef1c1c260935867fbfbae4ad42f94f..ca62f322dbcd51a3a2df5b3920520be196498034 100644 (file)
@@ -37,14 +37,14 @@ static pairs_st *global_pairs;
 static char *global_keys[GLOBAL_COUNT];
 static size_t global_keys_length[GLOBAL_COUNT];
 
-static test_return cleanup_pairs(memcached_st *memc __attribute__((unused)))
+static test_return_t cleanup_pairs(memcached_st *memc __attribute__((unused)))
 {
   pairs_free(global_pairs);
 
   return 0;
 }
 
-static test_return generate_pairs(memcached_st *memc __attribute__((unused)))
+static test_return_t generate_pairs(memcached_st *memc __attribute__((unused)))
 {
   unsigned long long x;
   global_pairs= pairs_generate(GLOBAL_COUNT, 400);
@@ -59,7 +59,7 @@ static test_return generate_pairs(memcached_st *memc __attribute__((unused)))
   return 0;
 }
 
-static test_return drizzle(memcached_st *memc)
+static test_return_t drizzle(memcached_st *memc)
 {
   unsigned int x;
   memcached_return rc;
@@ -153,7 +153,7 @@ static memcached_return enable_consistent(memcached_st *memc)
   Set the value, then quit to make sure it is flushed.
   Come back in and test that add fails.
 */
-static test_return add_test(memcached_st *memc)
+static test_return_t add_test(memcached_st *memc)
 {
   memcached_return rc;
   const char *key= "foo";
@@ -165,7 +165,7 @@ static test_return add_test(memcached_st *memc)
   rc= memcached_set(memc, key, strlen(key), 
                     value, strlen(value),
                     (time_t)0, (uint32_t)0);
-  assert(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
+  test_truth(rc == MEMCACHED_SUCCESS || rc == MEMCACHED_BUFFERED);
   memcached_quit(memc);
   rc= memcached_add(memc, key, strlen(key), 
                     value, strlen(value),
@@ -173,9 +173,13 @@ static test_return add_test(memcached_st *memc)
 
   /* Too many broken OS'es have broken loopback in async, so we can't be sure of the result */
   if (setting_value)
-    assert(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
+  {
+    test_truth(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
+  }
   else
-    assert(rc == MEMCACHED_NOTSTORED);
+  {
+    test_truth(rc == MEMCACHED_NOTSTORED);
+  }
 
   return 0;
 }
@@ -184,7 +188,7 @@ static test_return add_test(memcached_st *memc)
  * repeating add_tests many times
  * may show a problem in timing
  */
-static test_return many_adds(memcached_st *memc)
+static test_return_t many_adds(memcached_st *memc)
 {
   unsigned int i;
   for (i = 0; i < TEST_COUNTER; i++)