From: Brian Aker Date: Thu, 14 Jan 2010 19:06:45 +0000 (-0800) Subject: Fix atomsmasher test X-Git-Tag: 0.40~108 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=e5b935007a47da228caf3bcb2f61a84547ae4e9d;p=m6w6%2Flibmemcached Fix atomsmasher test --- diff --git a/tests/atomsmasher.c b/tests/atomsmasher.c index 3e759767..3d58960e 100644 --- a/tests/atomsmasher.c +++ b/tests/atomsmasher.c @@ -57,11 +57,10 @@ static test_return_t cleanup_pairs(memcached_st *memc __attribute__((unused))) static test_return_t generate_pairs(memcached_st *memc __attribute__((unused))) { - unsigned long long x; global_pairs= pairs_generate(GLOBAL_COUNT, 400); global_count= GLOBAL_COUNT; - for (x= 0; x < global_count; x++) + for (size_t x= 0; x < global_count; x++) { global_keys[x]= global_pairs[x].key; global_keys_length[x]= global_pairs[x].key_length; @@ -72,14 +71,13 @@ static test_return_t generate_pairs(memcached_st *memc __attribute__((unused))) static test_return_t drizzle(memcached_st *memc) { - unsigned int x; memcached_return_t rc; char *return_value; size_t return_value_length; uint32_t flags; infinite: - for (x= 0; x < TEST_COUNTER; x++) + for (size_t x= 0; x < TEST_COUNTER; x++) { uint32_t test_bit; uint8_t which; @@ -201,8 +199,7 @@ static test_return_t add_test(memcached_st *memc) */ static test_return_t many_adds(memcached_st *memc) { - unsigned int i; - for (i = 0; i < TEST_COUNTER; i++) + for (size_t x= 0; x < TEST_COUNTER; x++) { add_test(memc); } @@ -245,5 +242,8 @@ void get_world(world_st *world) world->test.post_run= (test_callback_fn)world_post_run; world->test.on_error= (test_callback_error_fn)world_on_error; + world->collection.startup= (test_callback_fn)world_container_startup; + world->collection.shutdown= (test_callback_fn)world_container_shutdown; + world->runner= &defualt_libmemcached_runner; } diff --git a/tests/include.am b/tests/include.am index 84951014..835096aa 100644 --- a/tests/include.am +++ b/tests/include.am @@ -123,17 +123,25 @@ MEMSLAP_COMMAND= clients/memslap $(COLLECTION) $(SUITE) MEM_COMMAND= tests/testapp $(COLLECTION) $(SUITE) +ATOM_COMMAND= tests/atomsmasher $(COLLECTION) $(SUITE) + HASH_COMMAND= tests/testhashkit $(COLLECTION) $(SUITE) test-mem: tests/testapp $(MEM_COMMAND) +test-atom: tests/atomsmasher + $(ATOM_COMMAND) + test-hash: tests/testhashkit $(HASH_COMMAND) gdb-mem: tests/testapp $(DEBUG_COMMAND) $(MEM_COMMAND) +gdb-atom: tests/atomsmasher + $(DEBUG_COMMAND) $(ATOM_COMMAND) + gdb-hash: tests/testhashkit $(DEBUG_COMMAND) $(HASH_COMMAND) @@ -143,6 +151,9 @@ gdb-memslap: clients/memslap valgrind-mem: tests/testapp $(VALGRIND_COMMAND) $(MEM_COMMAND) +valgrind-atom: tests/atomsmasher + $(VALGRIND_COMMAND) $(ATOM_COMMAND) + valgrind-hash: tests/testhashkit $(VALGRIND_COMMAND) $(HASH_COMMAND)