1 #include "test/lib/common.hpp"
2 #include "test/lib/MemcachedCluster.hpp"
4 TEST_CASE("memcached_exist") {
6 auto memc
= &test
.memc
;
7 auto binary
= GENERATE(0, 1);
9 test
.enableBinaryProto(binary
);
10 INFO("binary: " << binary
);
12 SECTION("initial not found") {
13 REQUIRE_RC(MEMCACHED_NOTFOUND
,memcached_exist(memc
, S("frog")));
16 SECTION("set found") {
17 REQUIRE_SUCCESS(memcached_set(memc
, S("frog"), S("frog"), 0, 0));
18 REQUIRE_SUCCESS(memcached_exist(memc
, S("frog")));
20 SECTION("deleted not found") {
21 REQUIRE_SUCCESS(memcached_delete(memc
, S("frog"), 0));
22 REQUIRE_RC(MEMCACHED_NOTFOUND
, memcached_exist(memc
, S("frog")));
27 SECTION("initial not found") {
28 REQUIRE_RC(MEMCACHED_NOTFOUND
, memcached_exist_by_key(memc
, S("master"), S("frog")));
31 SECTION("set found") {
32 REQUIRE_SUCCESS(memcached_set_by_key(memc
, S("master"), S("frog"), S("frog"), 0, 0));
33 REQUIRE_SUCCESS(memcached_exist_by_key(memc
, S("master"), S("frog")));
35 SECTION("deleted not found") {
36 REQUIRE_SUCCESS(memcached_delete_by_key(memc
, S("master"), S("frog"), 0));
37 REQUIRE_RC(MEMCACHED_NOTFOUND
, memcached_exist_by_key(memc
, S("master"), S("frog")));