+static test_return_t getpid_connection_failure_test(memcached_st *memc)
+{
+ memcached_return_t rc;
+ memcached_server_instance_st instance=
+ memcached_server_instance_by_position(memc, 0);
+
+ // Test both the version that returns a code, and the one that does not.
+ test_true(libmemcached_util_getpid(memcached_server_name(instance),
+ memcached_server_port(instance) -1, NULL) == -1);
+
+ test_true(libmemcached_util_getpid(memcached_server_name(instance),
+ memcached_server_port(instance) -1, &rc) == -1);
+ test_compare_got(MEMCACHED_CONNECTION_FAILURE, rc, memcached_strerror(memc, rc));
+
+ return TEST_SUCCESS;
+}
+
+
+static test_return_t getpid_test(memcached_st *memc)
+{
+ memcached_return_t rc;
+ memcached_server_instance_st instance=
+ memcached_server_instance_by_position(memc, 0);
+
+ // Test both the version that returns a code, and the one that does not.
+ test_true(libmemcached_util_getpid(memcached_server_name(instance),
+ memcached_server_port(instance), NULL) > -1);
+
+ test_true(libmemcached_util_getpid(memcached_server_name(instance),
+ memcached_server_port(instance), &rc) > -1);
+ test_compare(MEMCACHED_SUCCESS, rc);
+
+ return TEST_SUCCESS;
+}
+