1 #include "test/lib/common.hpp"
3 TEST_CASE("memcached_strings") {
5 string bad_string
{libmemcached_string_behavior(MEMCACHED_BEHAVIOR_MAX
)};
6 for (auto b
= 0; b
< MEMCACHED_BEHAVIOR_MAX
; ++b
) {
7 auto chk_string
= libmemcached_string_behavior(static_cast<memcached_behavior_t
>(b
));
8 INFO("missing entry for memcached_behavior_t(" << b
<< ")?");
10 REQUIRE(bad_string
!= chk_string
);
13 SECTION("distributions") {
14 string bad_string
{libmemcached_string_distribution(MEMCACHED_DISTRIBUTION_CONSISTENT_MAX
)};
15 for (auto d
= 0; d
< MEMCACHED_DISTRIBUTION_CONSISTENT_MAX
; ++d
) {
16 auto chk_string
= libmemcached_string_distribution(static_cast<memcached_server_distribution_t
>(d
));
17 INFO("missing entry for memcached_server_distribution_t(" << d
<< ")?");
19 REQUIRE(bad_string
!= chk_string
);
22 SECTION("return codes") {
24 string bad_string
{memcached_strerror(*memc
, MEMCACHED_MAXIMUM_RETURN
)};
25 for (auto r
= 0; r
< MEMCACHED_MAXIMUM_RETURN
; ++r
) {
26 auto chk_string
= memcached_strerror(*memc
, static_cast<memcached_return_t
>(r
));
27 INFO("missing entry for memcached_return_t(" << r
<< ")?");
29 REQUIRE(bad_string
!= chk_string
);