1 #include "test/lib/common.hpp"
2 #include "test/lib/MemcachedCluster.hpp"
4 TEST_CASE("memcached_regression_lp1048945") {
5 MemcachedPtr
memc_ptr(memcached_create(nullptr));
7 LoneReturnMatcher test
{memc
};
8 memcached_return status
;
10 auto list
= memcached_server_list_append_with_weight(nullptr, "a", 11211, 0, &status
);
11 REQUIRE_SUCCESS(status
);
13 list
= memcached_server_list_append_with_weight(list
, "b", 11211, 0, &status
);
14 REQUIRE_SUCCESS(status
);
16 list
= memcached_server_list_append_with_weight(list
, "c", 11211, 0, &status
);
17 REQUIRE_SUCCESS(status
);
19 REQUIRE(3 == memcached_server_list_count(list
));
21 REQUIRE_SUCCESS(memcached_server_push(memc
, list
));
22 REQUIRE_SUCCESS(memcached_server_push(memc
, list
));
23 memcached_server_list_free(list
);
25 auto server
= memcached_server_by_key(memc
, S(__func__
), &status
);
27 REQUIRE_SUCCESS(status
);