From 7253c10fe79f6a72b0aec419560823a16ad55a0a Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 20 Apr 2012 13:18:38 -0700 Subject: [PATCH] Remove final flush logic --- libtest/framework.cc | 4 +--- tests/failure.cc | 1 - tests/include.am | 1 - tests/libmemcached-1.0/all_tests.cc | 1 - tests/libmemcached-1.0/all_tests_socket.cc | 1 - tests/libmemcached-1.0/atomsmasher.cc | 1 - tests/libmemcached-1.0/generate.cc | 18 +++++++++++------- tests/libmemcached-1.0/plus.cpp | 1 - tests/libmemcached-1.0/sasl.cc | 1 - tests/libmemcached_world.h | 10 ---------- tests/libmemcached_world_socket.h | 10 ---------- tests/mem_udp.cc | 1 - 12 files changed, 12 insertions(+), 38 deletions(-) diff --git a/libtest/framework.cc b/libtest/framework.cc index 8e049e60..73e227e4 100644 --- a/libtest/framework.cc +++ b/libtest/framework.cc @@ -26,10 +26,8 @@ using namespace libtest; -static test_return_t _default_callback(void *p) +static test_return_t _default_callback(void*) { - (void)p; - return TEST_SUCCESS; } diff --git a/tests/failure.cc b/tests/failure.cc index 073cd17b..923cdf38 100644 --- a/tests/failure.cc +++ b/tests/failure.cc @@ -219,7 +219,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item.set_flush((test_callback_fn*)world_flush); world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; diff --git a/tests/include.am b/tests/include.am index ff5223fe..9e87ca17 100644 --- a/tests/include.am +++ b/tests/include.am @@ -18,7 +18,6 @@ DEBUG_COMMAND= $(LIBTOOL) --mode=execute gdb PAHOLE_COMMAND= $(LIBTOOL) --mode=execute pahole EXTRA_DIST+= tests/cpp_example.cc -EXTRA_DIST+= tests/output_plus.res noinst_HEADERS+= tests/exist.h noinst_HEADERS+= tests/keys.hpp diff --git a/tests/libmemcached-1.0/all_tests.cc b/tests/libmemcached-1.0/all_tests.cc index 74c195d2..a3615a81 100644 --- a/tests/libmemcached-1.0/all_tests.cc +++ b/tests/libmemcached-1.0/all_tests.cc @@ -88,7 +88,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item.set_flush((test_callback_fn*)world_flush); world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; diff --git a/tests/libmemcached-1.0/all_tests_socket.cc b/tests/libmemcached-1.0/all_tests_socket.cc index 046bd290..6037abe1 100644 --- a/tests/libmemcached-1.0/all_tests_socket.cc +++ b/tests/libmemcached-1.0/all_tests_socket.cc @@ -77,7 +77,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item.set_flush((test_callback_fn*)world_flush); world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; diff --git a/tests/libmemcached-1.0/atomsmasher.cc b/tests/libmemcached-1.0/atomsmasher.cc index 2b7e9c12..7ca5cbd4 100644 --- a/tests/libmemcached-1.0/atomsmasher.cc +++ b/tests/libmemcached-1.0/atomsmasher.cc @@ -285,7 +285,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item._flush= (test_callback_fn*)world_flush; world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; diff --git a/tests/libmemcached-1.0/generate.cc b/tests/libmemcached-1.0/generate.cc index 9f677584..419d1ca2 100644 --- a/tests/libmemcached-1.0/generate.cc +++ b/tests/libmemcached-1.0/generate.cc @@ -94,7 +94,7 @@ test_return_t generate_large_pairs(memcached_st *memc) 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"); + test_true(check_execute > (global_count / 2)); return TEST_SUCCESS; } @@ -105,7 +105,8 @@ test_return_t generate_data(memcached_st *memc) 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"); + test_true_hint(check_execute > (global_count / 2), + "Possible false, positive, memcached may have ejected key/value based on memory needs"); return TEST_SUCCESS; } @@ -203,7 +204,8 @@ test_return_t get_read(memcached_st *memc) free(return_value); } } - test_compare_warn_hint(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + test_true_hint(keys_returned > (global_count / 2), + "Possible false, positive, memcached may have ejected key/value based on memory needs"); return TEST_SUCCESS; } @@ -220,8 +222,7 @@ test_return_t mget_read(memcached_st *memc) { unsigned int keys_returned; test_compare(TEST_SUCCESS, fetch_all_results(memc, keys_returned)); - test_true(keys_returned > 0); - test_compare_warn_hint(global_count, keys_returned, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + test_true(keys_returned > (global_count / 2)); } return TEST_SUCCESS; @@ -329,7 +330,8 @@ test_return_t delete_generate(memcached_st *memc) total++; } } - test_compare_warn_hint(global_count, total, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + test_true_hint(total > (global_count / 2), + "Possible false, positive, memcached may have ejected key/value based on memory needs"); return TEST_SUCCESS; } @@ -346,7 +348,9 @@ test_return_t delete_buffer_generate(memcached_st *memc) total++; } } - test_compare_warn_hint(global_count, total, "Possible false, positive, memcached may have ejected key/value based on memory needs"); + + test_true_hint(total > (global_count / 2), + "Possible false, positive, memcached may have ejected key/value based on memory needs"); return TEST_SUCCESS; } diff --git a/tests/libmemcached-1.0/plus.cpp b/tests/libmemcached-1.0/plus.cpp index bd19feb0..d2f89053 100644 --- a/tests/libmemcached-1.0/plus.cpp +++ b/tests/libmemcached-1.0/plus.cpp @@ -292,7 +292,6 @@ void get_world(Framework *world) world->_destroy= world_destroy; world->item._startup= reinterpret_cast(world_test_startup); - world->item._flush= reinterpret_cast(world_flush); world->_on_error= reinterpret_cast(world_on_error); world->collection_startup= reinterpret_cast(world_container_startup); diff --git a/tests/libmemcached-1.0/sasl.cc b/tests/libmemcached-1.0/sasl.cc index ee421300..3a4dfdf1 100644 --- a/tests/libmemcached-1.0/sasl.cc +++ b/tests/libmemcached-1.0/sasl.cc @@ -107,7 +107,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item.set_flush((test_callback_fn*)world_flush); world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; diff --git a/tests/libmemcached_world.h b/tests/libmemcached_world.h index ded47ada..2d05a5d5 100644 --- a/tests/libmemcached_world.h +++ b/tests/libmemcached_world.h @@ -150,16 +150,6 @@ static test_return_t world_test_startup(libmemcached_test_container_st *containe return TEST_SUCCESS; } -test_return_t world_flush(libmemcached_test_container_st *container); -test_return_t world_flush(libmemcached_test_container_st *container) -{ - test_true(container->memc); - memcached_flush(container->memc, 0); - memcached_quit(container->memc); - - return TEST_SUCCESS; -} - static test_return_t world_on_error(test_return_t , libmemcached_test_container_st *container) { test_true(container->memc); diff --git a/tests/libmemcached_world_socket.h b/tests/libmemcached_world_socket.h index 4080a1b0..cda99951 100644 --- a/tests/libmemcached_world_socket.h +++ b/tests/libmemcached_world_socket.h @@ -131,16 +131,6 @@ static test_return_t world_test_startup(libmemcached_test_container_st *containe return TEST_SUCCESS; } -test_return_t world_flush(libmemcached_test_container_st *container); -test_return_t world_flush(libmemcached_test_container_st *container) -{ - test_true(container->memc); - memcached_flush(container->memc, 0); - memcached_quit(container->memc); - - return TEST_SUCCESS; -} - static test_return_t world_on_error(test_return_t , libmemcached_test_container_st *container) { test_true(container->memc); diff --git a/tests/mem_udp.cc b/tests/mem_udp.cc index 17f9f55f..a07d4166 100644 --- a/tests/mem_udp.cc +++ b/tests/mem_udp.cc @@ -572,7 +572,6 @@ void get_world(Framework *world) world->_destroy= (test_callback_destroy_fn*)world_destroy; world->item._startup= (test_callback_fn*)world_test_startup; - world->item._flush= (test_callback_fn*)world_flush; world->_on_error= (test_callback_error_fn*)world_on_error; world->collection_startup= (test_callback_fn*)world_container_startup; -- 2.30.2