Skip to content

Commit b73f12a

Browse files
committed
verfy lp#1630615 is not an issue anymore and close #75
1 parent a111d27 commit b73f12a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#include "test/lib/common.hpp"
2+
#include "test/lib/Shell.hpp"
3+
#include "test/lib/MemcachedCluster.hpp"
4+
#include "test/fixtures/callbacks.hpp"
5+
6+
TEST_CASE("memcached_regression_lp1630615") {
7+
#if !LIBMEMCACHED_WITH_SASL_SUPPORT
8+
WARN("ENABLE_SASL=OFF");
9+
#else
10+
Shell sh;
11+
string mc{MEMCACHED_BINARY}, err;
12+
13+
if (!sh.run(mc + " -S --version", err)) {
14+
WARN(mc << ": " << err);
15+
} else {
16+
memcached_return_t rc;
17+
auto test = MemcachedCluster::sasl();
18+
auto memc = &test.memc;
19+
MemcachedPtr copy{memcached_clone(nullptr, memc)};
20+
21+
REQUIRE(memcached_server_by_key(memc, S(__func__), &rc)->fd == INVALID_SOCKET);
22+
REQUIRE_SUCCESS(memcached_set(memc, S(__func__), S(__func__), 0, 0));
23+
REQUIRE(memcached_server_by_key(memc, S(__func__), &rc)->fd != INVALID_SOCKET);
24+
25+
REQUIRE(memcached_server_by_key(*copy, S(__func__), &rc)->fd == INVALID_SOCKET);
26+
Malloced val{memcached_get(*copy, S(__func__), nullptr, nullptr, &rc)};
27+
REQUIRE(memcached_server_by_key(*copy, S(__func__), &rc)->fd != INVALID_SOCKET);
28+
29+
REQUIRE_SUCCESS(rc);
30+
REQUIRE(*val);
31+
REQUIRE(string(__func__) == string(*val));
32+
}
33+
#endif
34+
}

0 commit comments

Comments
 (0)