libmemcached: fix #125: allocation failure on negative expiration
[awesomized/libmemcached] / test / tests / memcached / regression / gh_0125.cpp
1 #include "test/lib/common.hpp"
2 #include "test/lib/MemcachedCluster.hpp"
3
4 TEST_CASE("memcached_regression_gh_0125") {
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 memcached_return_t rc = memcached_set(memc, S("key"), blob.c_str(), blob.length(), -123, 0);
14 REQUIRE_SUCCESS(rc);
15 }