From: Brian Aker Date: Mon, 16 Apr 2012 04:02:48 +0000 (-0700) Subject: Breakup generate tests. X-Git-Tag: 1.0.7~7^2^2^2~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1ad78a588c2899f9f42d5e51352e57ef6cdbdf8e;p=m6w6%2Flibmemcached Breakup generate tests. --- diff --git a/tests/libmemcached-1.0/all_tests.h b/tests/libmemcached-1.0/all_tests.h index cd9b5163..dfc7f259 100644 --- a/tests/libmemcached-1.0/all_tests.h +++ b/tests/libmemcached-1.0/all_tests.h @@ -285,8 +285,12 @@ test_st generate_tests[] ={ {"generate_data", true, (test_callback_fn*)generate_data }, {"get_read", false, (test_callback_fn*)get_read }, {"delete_generate", false, (test_callback_fn*)delete_generate }, + {"cleanup", true, (test_callback_fn*)cleanup_pairs }, + // New start {"generate_buffer_data", true, (test_callback_fn*)generate_buffer_data }, {"delete_buffer", false, (test_callback_fn*)delete_buffer_generate}, + {"cleanup", true, (test_callback_fn*)cleanup_pairs }, + // New start {"generate_data", true, (test_callback_fn*)generate_data }, {"mget_read", false, (test_callback_fn*)mget_read }, {"mget_read_result", false, (test_callback_fn*)mget_read_result }, @@ -294,9 +298,11 @@ test_st generate_tests[] ={ {"memcached_fetch_result() partial read", false, (test_callback_fn*)mget_read_partial_result }, {"mget_read_function", false, (test_callback_fn*)mget_read_function }, {"cleanup", true, (test_callback_fn*)cleanup_pairs }, + {0, 0, (test_callback_fn*)0} +}; + +test_st generate_large_TESTS[] ={ {"generate_large_pairs", true, (test_callback_fn*)generate_large_pairs }, - {"generate_data", true, (test_callback_fn*)generate_data }, - {"generate_buffer_data", true, (test_callback_fn*)generate_buffer_data }, {"cleanup", true, (test_callback_fn*)cleanup_pairs }, {0, 0, (test_callback_fn*)0} }; @@ -465,6 +471,7 @@ collection_st collection[] ={ {"Cal Haldenbrand's tests", 0, 0, haldenbrand_TESTS}, {"user written tests", 0, 0, user_tests}, {"generate", 0, 0, generate_tests}, + {"generate large", 0, 0, generate_large_TESTS}, {"generate_hsieh", (test_callback_fn*)pre_hsieh, 0, generate_tests}, {"generate_ketama", (test_callback_fn*)pre_behavior_ketama, 0, generate_tests}, {"generate_hsieh_consistent", (test_callback_fn*)enable_consistent_hsieh, 0, generate_tests}, diff --git a/tests/libmemcached-1.0/generate.cc b/tests/libmemcached-1.0/generate.cc index 4f1db4c9..79caa5fb 100644 --- a/tests/libmemcached-1.0/generate.cc +++ b/tests/libmemcached-1.0/generate.cc @@ -80,7 +80,7 @@ static test_return_t generate_pairs(memcached_st *) return TEST_SUCCESS; } -test_return_t generate_large_pairs(memcached_st *) +test_return_t generate_large_pairs(memcached_st *memc) { global_pairs= pairs_generate(GLOBAL2_COUNT, MEMCACHED_MAX_BUFFER+10); global_count= GLOBAL2_COUNT; @@ -91,6 +91,11 @@ test_return_t generate_large_pairs(memcached_st *) global_keys_length[x]= global_pairs[x].key_length; } + memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, true); + unsigned int check_execute= execute_set(memc, global_pairs, global_count); + + test_compare_warn_hint(global_count, check_execute, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + return TEST_SUCCESS; }