Merge Thomason's cork patch.
[awesomized/libmemcached] / tests / libmemcached_world.h
index 4092d95104773c9930c151e4d4b4c34cb31db952..aab09ea3e5ed0cfcfd6d27503bc3ecfb5b3bcf16 100644 (file)
@@ -96,12 +96,13 @@ test_return_t world_flush(libmemcached_test_container_st *container)
 
 test_return_t world_pre_run(libmemcached_test_container_st *container)
 {
-  uint32_t loop;
-
-  for (loop= 0; loop < memcached_server_list_count(container->construct.servers); loop++)
+  for (uint32_t loop= 0; loop < memcached_server_list_count(container->construct.servers); loop++)
   {
-    test_truth(container->memc->hosts[loop].fd == -1);
-    test_truth(container->memc->hosts[loop].cursor_active == 0);
+    memcached_server_st *instance=
+      memcached_server_instance_fetch(container->memc, loop);
+
+    test_truth(instance->fd == -1);
+    test_truth(instance->cursor_active == 0);
   }
 
   return TEST_SUCCESS;
@@ -110,7 +111,7 @@ test_return_t world_pre_run(libmemcached_test_container_st *container)
 
 test_return_t world_post_run(libmemcached_test_container_st *container)
 {
-  assert(container->memc);
+  test_truth(container->memc);
 
   return TEST_SUCCESS;
 }