1 #include "test/lib/common.hpp"
3 #include "libmemcached/is.h"
5 TEST_CASE("memcached_basic") {
7 REQUIRE(string(LIBMEMCACHED_VERSION_STRING
) == memcached_lib_version());
9 SECTION("memcached_st") {
10 memcached_st memc
, *memc_ptr
;
12 memc_ptr
= memcached_create(&memc
);
15 REQUIRE(memc_ptr
== &memc
);
17 SECTION("can be cloned") {
18 memc_ptr
= memcached_clone(nullptr, &memc
);
20 REQUIRE(memcached_is_allocated(memc_ptr
));
21 memcached_free(memc_ptr
);
24 SECTION("can be reset") {
25 memc_ptr
= memcached_clone(nullptr, &memc
);
26 REQUIRE(MEMCACHED_SUCCESS
== memcached_reset(&memc
));
27 REQUIRE_FALSE(memcached_is_allocated(&memc
));
28 REQUIRE(MEMCACHED_SUCCESS
== memcached_reset(memc_ptr
));
29 REQUIRE(memcached_is_allocated(memc_ptr
));
30 memcached_free(memc_ptr
);