X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2Ftests%2Fmemcached%2Fregression%2Flp_000-447-342.cpp;h=3ab5112f9a5f6551211c8fe072b0c47976416484;hb=7883b530881983213dffaa6c71ace9204bedb82a;hp=9e6c078d907b769c989bbc84a3454d277e6399bd;hpb=70c662f31502f6d76a973fcb0c86a093889c6e0d;p=awesomized%2Flibmemcached diff --git a/test/tests/memcached/regression/lp_000-447-342.cpp b/test/tests/memcached/regression/lp_000-447-342.cpp index 9e6c078d..3ab5112f 100644 --- a/test/tests/memcached/regression/lp_000-447-342.cpp +++ b/test/tests/memcached/regression/lp_000-447-342.cpp @@ -1,27 +1,20 @@ #include "test/lib/common.hpp" #include "test/lib/MemcachedCluster.hpp" - +#include "test/fixtures/callbacks.hpp" #include "libmemcached/instance.hpp" -static memcached_return_t callback_counter(const memcached_st *, memcached_result_st *, void *context) { - auto *counter= reinterpret_cast(context); - *counter = *counter + 1; - - return MEMCACHED_SUCCESS; -} - #define NUM_KEYS 100U TEST_CASE("memcached_regression_lp447342") { - auto test = MemcachedCluster::mixed(); + auto test = MemcachedCluster::network(); auto memc = &test.memc; - + REQUIRE_SUCCESS(memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, 2)); - + array str; array chr; array len; - + for (auto i = 0U; i < NUM_KEYS; ++i) { str[i] = random_ascii_string(random_num(12, 16)) + to_string(i); chr[i] = str[i].data(); @@ -30,7 +23,7 @@ TEST_CASE("memcached_regression_lp447342") { } /* - ** We are using the qiet command to store the replicas, so we need + ** We are using the quit command to store the replicas, so we need ** to ensure that all of them are processed before we can continue. ** In the test we go directly from storing the object to trying to ** receive the object from all of the different servers, so we @@ -42,16 +35,16 @@ TEST_CASE("memcached_regression_lp447342") { ** as an example for your own code, please note that you shouldn't need ** to do this ;-) */ - + memcached_quit(memc); - + REQUIRE_SUCCESS(memcached_mget(memc, chr.data(), len.data(), NUM_KEYS)); size_t counter = 0; memcached_execute_fn cb[] = {&callback_counter}; REQUIRE_SUCCESS(memcached_fetch_execute(memc, cb, &counter, 1)); REQUIRE(counter == NUM_KEYS); - + memcached_quit(memc); /*