X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Flibmemcached-1.0%2Fmem_functions.cc;h=5c0ada030325a56324fa00811b8d9e5f12d5d276;hb=5deca7af238185cfb53be80909b45ed807282b26;hp=e39c2a8bc8eccc134e4a30462f04637092eb7da4;hpb=560784bd3bc77b292761ef878dfb5f6205054946;p=m6w6%2Flibmemcached diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index e39c2a8b..5c0ada03 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -1699,7 +1699,7 @@ test_return_t mget_execute(memcached_st *original_memc) } #define REGRESSION_BINARY_VS_BLOCK_COUNT 20480 -static pairs_st *global_pairs; +static pairs_st *global_pairs= NULL; test_return_t key_setup(memcached_st *memc) { @@ -1713,6 +1713,7 @@ test_return_t key_setup(memcached_st *memc) test_return_t key_teardown(memcached_st *) { pairs_free(global_pairs); + global_pairs= NULL; return TEST_SUCCESS; } @@ -1722,9 +1723,14 @@ test_return_t block_add_regression(memcached_st *memc) /* First add all of the items.. */ for (ptrdiff_t x= 0; x < REGRESSION_BINARY_VS_BLOCK_COUNT; ++x) { - char blob[1024] = {0}; - - memcached_return_t rc= memcached_add_by_key(memc, "bob", 3, global_pairs[x].key, global_pairs[x].key_length, blob, sizeof(blob), 0, 0); + libtest::vchar_t blob; + libtest::vchar::make(blob, 1024); + + memcached_return_t rc= memcached_add_by_key(memc, + test_literal_param("bob"), + global_pairs[x].key, global_pairs[x].key_length, + &blob[0], blob.size(), + time_t(0), uint32_t(0)); test_true_got(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE, memcached_strerror(NULL, rc)); }