testing: pools + mac
[awesomized/libmemcached] / test / tests / memcached / regression / binary_block_add.cpp
1 #include "test/lib/common.hpp"
2 #include "test/lib/MemcachedCluster.hpp"
3
4 TEST_CASE("memcached_regression_binary_block_add") {
5 auto test = MemcachedCluster::network();
6 auto memc = &test.memc;
7 auto blob = random_ascii_string(1024);
8 auto binary = GENERATE(0, 1);
9
10 test.enableBinaryProto(binary);
11 INFO("binary: " << binary);
12
13 for (auto i = 0; i < 20480; ++i) {
14 auto rkey = random_ascii_string(12) + to_string(i);
15 memcached_return_t rc = memcached_add_by_key(memc, S("key"), rkey.c_str(), rkey.length(), blob.c_str(), blob.length(), 0, 0);
16
17 if (rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE) {
18 break;
19 } else if (rc != MEMCACHED_DATA_EXISTS) {
20 REQUIRE_SUCCESS(rc);
21 }
22 }
23 }