X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flibmemcached-1.0%2Fmem_functions.cc;h=38c0db77e88a90e967128531b273ec0387f3b646;hb=d4c8a38faeda1342d57c2ba74e073d6a2899e558;hp=3884ac52e5fb0b10372f67f769a2951aab73c8e8;hpb=23dca174eef8d846e3d4402729b57f6ded035e64;p=m6w6%2Flibmemcached diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index 3884ac52..38c0db77 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -1845,6 +1845,34 @@ test_return_t add_host_test(memcached_st *memc) return TEST_SUCCESS; } +test_return_t regression_1048945_TEST(memcached_st*) +{ + memcached_return status; + + memcached_server_st* list= memcached_server_list_append_with_weight(NULL, "a", 11211, 0, &status); + test_compare(status, MEMCACHED_SUCCESS); + + list= memcached_server_list_append_with_weight(list, "b", 11211, 0, &status); + test_compare(status, MEMCACHED_SUCCESS); + + list= memcached_server_list_append_with_weight(list, "c", 11211, 0, &status); + test_compare(status, MEMCACHED_SUCCESS); + + memcached_st* memc= memcached_create(NULL); + + status= memcached_server_push(memc, list); + memcached_server_list_free(list); + test_compare(status, MEMCACHED_SUCCESS); + + memcached_server_instance_st server= memcached_server_by_key(memc, test_literal_param(__func__), &status); + test_true(server); + test_compare(status, MEMCACHED_SUCCESS); + + memcached_free(memc); + + return TEST_SUCCESS; +} + test_return_t memcached_fetch_result_NOT_FOUND(memcached_st *memc) { memcached_return_t rc;