+static test_return_t alive(memcached_st *memc)
+{
+ test_true(memc);
+ test_true(memcached_is_allocated(memc));
+ for (uint32_t x= 0; x < memcached_server_count(memc); ++x)
+ {
+ memcached_server_instance_st instance= memcached_server_instance_by_position(memc, x);
+ test_true(instance);
+
+ test_true(libmemcached_util_ping(memcached_server_name(instance),
+ memcached_server_port(instance), NULL));
+ }
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t valid(memcached_st *memc)
+{
+ test_true(memc);
+ test_true(memcached_is_allocated(memc));
+
+ for (uint32_t x= 0; x < memcached_server_count(memc); ++x)
+ {
+ memcached_server_instance_st instance= memcached_server_instance_by_position(memc, x);
+ test_true(instance);
+
+ pid_t pid= libmemcached_util_getpid(memcached_server_name(instance),
+ memcached_server_port(instance), NULL);
+ test_true(pid != -1);
+ }
+
+ return TEST_SUCCESS;
+}
+
+test_st ping_tests[] ={
+ {"alive", true, (test_callback_fn*)alive },
+ {0, 0, 0}
+};
+
+test_st getpid_tests[] ={
+ {"valid", true, (test_callback_fn*)valid },