X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flibmemcached_world.h;h=b608d9ae953294824ef558d06c13d48b5e15f3bc;hb=ff452398ec3114d6af77aa5d2d77f53b18d980e3;hp=4652b2460d9ee908a62c00d7b40bd25286935f24;hpb=d753fca27268b2d3ab6bce64411c65287acbe25d;p=m6w6%2Flibmemcached diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h index 4652b246..b608d9ae 100644 --- a/tests/libmemcached_world.h +++ b/tests/libmemcached_world.h @@ -98,8 +98,8 @@ test_return_t world_pre_run(libmemcached_test_container_st *container) { for (uint32_t loop= 0; loop < memcached_server_list_count(container->construct.servers); loop++) { - memcached_server_st *instance= - memcached_server_instance_fetch(container->memc, loop); + memcached_server_instance_st instance= + memcached_server_instance_by_position(container->memc, loop); test_true(instance->fd == -1); test_true(instance->cursor_active == 0); @@ -149,6 +149,30 @@ static test_return_t _runner_default(libmemcached_test_callback_fn func, libmemc } } +static test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container) +{ + if (func) + { + return func(container->parent); + } + else + { + return TEST_SUCCESS; + } +} + +static test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container) +{ + if (func) + { + return func(container->parent); + } + else + { + return TEST_SUCCESS; + } +} + #ifdef __cplusplus } #endif @@ -156,17 +180,17 @@ static test_return_t _runner_default(libmemcached_test_callback_fn func, libmemc #ifdef __cplusplus static world_runner_st defualt_libmemcached_runner= { + reinterpret_cast(_pre_runner_default), reinterpret_cast(_runner_default), - reinterpret_cast(_runner_default), - reinterpret_cast(_runner_default) + reinterpret_cast(_post_runner_default) }; #else static world_runner_st defualt_libmemcached_runner= { + (test_callback_runner_fn)_pre_runner_default, (test_callback_runner_fn)_runner_default, - (test_callback_runner_fn)_runner_default, - (test_callback_runner_fn)_runner_default + (test_callback_runner_fn)_post_runner_default }; #endif