{ }
};
-#define SERVERS_TO_CREATE 5
-
static void *world_create(server_startup_st& servers, test_return_t& error)
{
- if (LIBMEMCACHED_WITH_SASL_SUPPORT == 0)
+ if (HAVE_MEMCACHED_BINARY == 0)
+ {
+ error= TEST_SKIPPED;
+ return NULL;
+ }
+
+ if (servers.sasl() and (LIBMEMCACHED_WITH_SASL_SUPPORT == 0 or MEMCACHED_SASL_BINARY == 0))
{
error= TEST_SKIPPED;
return NULL;
return NULL;
}
-
- in_port_t max_port;
- for (uint32_t x= 0; x < SERVERS_TO_CREATE; x++)
+ in_port_t max_port= TEST_PORT_BASE;
+ for (uint32_t x= 0; x < servers.count(); x++)
{
in_port_t port;
{
if (not server_startup(servers, "memcached-sasl", port, 1, argv))
{
- error= TEST_FAILURE;
+ error= TEST_FATAL;
return NULL;
}
}
{
if (not server_startup(servers, "memcached", port, 1, argv))
{
- error= TEST_FAILURE;
+ error= TEST_FATAL;
return NULL;
}
}
const char *argv[1]= { "memcached" };
if (not servers.start_socket_server("memcached-sasl", max_port +1, 1, argv))
{
- error= TEST_FAILURE;
+ error= TEST_FATAL;
return NULL;
}
}
const char *argv[1]= { "memcached" };
if (not servers.start_socket_server("memcached", max_port +1, 1, argv))
{
- error= TEST_FAILURE;
+ error= TEST_FATAL;
return NULL;
}
}
buffer, sizeof(buffer)),
container->construct.option_string().c_str());
- test_true(not container->parent);
+ test_null(container->parent);
container->parent= memcached(container->construct.option_string().c_str(), container->construct.option_string().size());
test_true(container->parent);
+ test_compare(MEMCACHED_SUCCESS, memcached_version(container->parent));
if (container->construct.sasl())
{
static test_return_t world_test_startup(libmemcached_test_container_st *container)
{
test_true(container);
- test_true(not container->memc);
+ test_null(container->memc);
test_true(container->parent);
container->memc= memcached_clone(NULL, container->parent);
test_true(container->memc);
return TEST_SUCCESS;
}
-static test_return_t world_on_error(test_return_t test_state, libmemcached_test_container_st *container)
+static test_return_t world_on_error(test_return_t , libmemcached_test_container_st *container)
{
- (void)test_state;
test_true(container->memc);
memcached_free(container->memc);
container->memc= NULL;
{
test_true(container);
test_true(container->memc);
- return func(container->memc);
+ test_return_t ret;
+ try {
+ ret= func(container->memc);
+ }
+ catch (std::exception& e)
+ {
+ Error << e.what();
+ return TEST_FAILURE;
+ }
+
+ return ret;
}
return TEST_SUCCESS;