testing
[awesomized/libmemcached] / test / tests / memcached / util.cpp
index ae91ffa42872b0af0cf91f9288a5885123056f40..3256fced7d7b01c58d54f05793f0698df90cc3a9 100644 (file)
@@ -1,17 +1,10 @@
 #include "test/lib/common.hpp"
 #include "test/lib/MemcachedCluster.hpp"
+#include "test/fixtures/callbacks.hpp"
 
 #include "libmemcached/instance.hpp"
 #include "libmemcachedutil/common.h"
 
-static memcached_return_t ping_callback(const memcached_st *, const memcached_instance_st *instance, void *) {
-  memcached_return_t rc;
-
-  REQUIRE(libmemcached_util_ping(memcached_server_name(instance), memcached_server_port(instance), &rc));
-  REQUIRE(rc == MEMCACHED_SUCCESS);
-  return MEMCACHED_SUCCESS;
-}
-
 TEST_CASE("memcached_util") {
   SECTION("version_check") {
     auto test = MemcachedCluster::mixed();
@@ -43,6 +36,7 @@ TEST_CASE("memcached_util") {
     }
   }
 
+  // see sasl.cpp for getpid2 test
   SECTION("getpid") {
     auto test = MemcachedCluster::network();
     memcached_return_t rc;
@@ -53,9 +47,10 @@ TEST_CASE("memcached_util") {
     }
 
     REQUIRE(-1 == libmemcached_util_getpid("localhost", 1, &rc));
-    REQUIRE_RC(MEMCACHED_CONNECTION_FAILURE, rc);
+    REQUIRE(memcached_fatal(rc));
   }
 
+  // see sasl.cpp for ping2 test
   SECTION("ping") {
     auto test = MemcachedCluster::network();
     auto memc = &test.memc;