Import/Merge of libtest latest.
[m6w6/libmemcached] / tests / libmemcached-1.0 / generate.cc
index 836ea2c9967eaa816178e97850bea1833e6f8ebd..59fa2b2ac63ef62a09c243f39745571ed7af2fff 100644 (file)
@@ -105,8 +105,10 @@ test_return_t generate_data(memcached_st *memc)
 
   unsigned int check_execute= execute_set(memc, global_pairs, global_count);
 
-  test_true_hint(check_execute > (global_count / 2),
-                 "Possible false, positive, memcached may have ejected key/value based on memory needs");
+  /* Possible false, positive, memcached may have ejected key/value based on
+   * memory needs. */
+
+  test_true(check_execute > (global_count / 2));
 
   return TEST_SUCCESS;
 }
@@ -132,7 +134,11 @@ test_return_t generate_data_with_stats(memcached_st *memc)
       memcached_server_instance_st instance=
         memcached_server_instance_by_position(memc, host_index);
 
-      printf("\nserver %u|%s|%u bytes: %llu\n", host_index, instance->hostname, instance->port, (unsigned long long)(stat_p + host_index)->bytes);
+      printf("\nserver %u|%s|%u bytes: %llu\n",
+             host_index,
+             memcached_server_name(instance),
+             memcached_server_port(instance),
+             (unsigned long long)(stat_p + host_index)->bytes);
     }
     test_true((unsigned long long)(stat_p + host_index)->bytes);
   }
@@ -204,8 +210,10 @@ test_return_t get_read(memcached_st *memc)
       free(return_value);
     }
   }
-  test_true_hint(keys_returned > (global_count / 2),
-                 "Possible false, positive, memcached may have ejected key/value based on memory needs");
+  /*
+    Possible false, positive, memcached may have ejected key/value based on memory needs.
+  */
+  test_true(keys_returned > (global_count / 2));
 
   return TEST_SUCCESS;
 }
@@ -330,8 +338,10 @@ test_return_t delete_generate(memcached_st *memc)
       total++;
     }
   }
-  test_true_hint(total > (global_count / 2),
-                 "Possible false, positive, memcached may have ejected key/value based on memory needs");
+  /*
+    Possible false, positive, memcached may have ejected key/value based on memory needs.
+  */
+  test_true(total > (global_count / 2));
 
   return TEST_SUCCESS;
 }
@@ -349,8 +359,10 @@ test_return_t delete_buffer_generate(memcached_st *memc)
     }
   }
 
-  test_true_hint(total > (global_count / 2),
-                 "Possible false, positive, memcached may have ejected key/value based on memory needs");
+  /*
+     Possible false, positive, memcached may have ejected key/value based on memory needs.
+  */
+  test_true(total > (global_count / 2));
 
   return TEST_SUCCESS;
 }