Fix atomsmasher test
authorBrian Aker <brian@gaz>
Thu, 14 Jan 2010 19:06:45 +0000 (11:06 -0800)
committerBrian Aker <brian@gaz>
Thu, 14 Jan 2010 19:06:45 +0000 (11:06 -0800)
tests/atomsmasher.c
tests/include.am

index 3e759767c9b74c16e6c5bd5352feebec82e69869..3d58960e9b4feb838fbc22534e19f95a91759950 100644 (file)
@@ -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;
 }
index 84951014d7a84bbe01619488ceece238c9f4074b..835096aadb2f67a1c9a15fe34ff599f24247d9b2 100644 (file)
@@ -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)