testing: fix osx
[m6w6/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
9 test.enableBinaryProto();
10
11 for (auto i = 0; i < 20480; ++i) {
12 auto rkey = random_ascii_string(12);
13 memcached_return_t rc = memcached_add_by_key(memc, S("key"), rkey.c_str(), rkey.length(), blob.c_str(), blob.length(), 0, 0);
14
15 if (rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE) {
16 break;
17 } else if (rc != MEMCACHED_DATA_EXISTS) {
18 REQUIRE_SUCCESS(rc);
19 }
20 }
21 }