Update for to allow for generate to be cleaned up.
authorBrian Aker <brian@tangent.org>
Mon, 16 Apr 2012 07:48:35 +0000 (00:48 -0700)
committerBrian Aker <brian@tangent.org>
Mon, 16 Apr 2012 07:48:35 +0000 (00:48 -0700)
clients/generator.cc
tests/include.am
tests/libmemcached-1.0/generate.cc
tests/libmemcached-1.0/include.am
tests/runner.h

index 011ed3a499bb778ed5963d3695d4cb48088967b3..c62f9a32214cb8af49086781f2cfab0e759a8553 100644 (file)
@@ -44,7 +44,9 @@ static void get_random_string(char *buffer, size_t size)
 void pairs_free(pairs_st *pairs)
 {
   if (pairs == NULL)
+  {
     return;
+  }
 
   /* We free until we hit the null pair we stores during creation */
   for (uint32_t x= 0; pairs[x].key; x++)
index c6e59f9969e7cc5d99da363b9c32f79c8f73a159..ff5223fe09df1392eb04fe6f3cf443fcef323f0f 100644 (file)
@@ -40,7 +40,14 @@ noinst_PROGRAMS+= tests/cycle
 
 include tests/libmemcached-1.0/include.am
 
-tests_failure_SOURCES= tests/failure.cc
+tests_failure_SOURCES=
+tests_failure_SOURCES+= tests/failure.cc
+tests_failure_SOURCES+= clients/execute.cc
+tests_failure_SOURCES+= clients/generator.cc
+tests_failure_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_failure_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_failure_SOURCES+= tests/libmemcached-1.0/generate.cc
+
 tests_failure_CXXFLAGS = $(AM_CXXFLAGS)
 tests_failure_DEPENDENCIES= $(TESTS_LDADDS)
 tests_failure_LDADD= $(tests_failure_DEPENDENCIES)
index 79caa5fb40410ee52ca6d2c34ef79500ba25e30b..9f6775843894c11269ed4e88d8e7a9ef7d7f9a83 100644 (file)
 
 using namespace libtest;
 
-static pairs_st *global_pairs;
+static pairs_st *global_pairs= NULL;
 static const char *global_keys[GLOBAL_COUNT];
 static size_t global_keys_length[GLOBAL_COUNT];
 static size_t global_count= 0;
 
-test_return_t cleanup_pairs(memcached_st *memc)
+test_return_t cleanup_pairs(memcached_st*)
 {
-  (void)memc;
   pairs_free(global_pairs);
+  global_pairs= NULL;
 
   return TEST_SUCCESS;
 }
index 186e655bfe32deb713f7160bcf57aa6caf022f9d..d4b3fc14468b33653c37111c7f7a3b0e6b5e79a5 100644 (file)
@@ -56,9 +56,11 @@ tests_libmemcached_1_0_testapp_CXXFLAGS =  $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
 tests_libmemcached_1_0_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
 tests_libmemcached_1_0_testapp_SOURCES=
 tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/all_tests.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_libmemcached_1_0_testapp_SOURCES+= tests/libmemcached-1.0/generate.cc
 tests_libmemcached_1_0_testapp_SOURCES+= \
                                         tests/libmemcached-1.0/basic.cc \
-                                        tests/libmemcached-1.0/callback_counter.cc \
                                         tests/libmemcached-1.0/callbacks.cc \
                                         tests/libmemcached-1.0/debug.cc \
                                         tests/libmemcached-1.0/deprecated.cc \
@@ -66,8 +68,6 @@ tests_libmemcached_1_0_testapp_SOURCES+= \
                                         tests/libmemcached-1.0/encoding_key.cc \
                                         tests/libmemcached-1.0/error_conditions.cc \
                                         tests/libmemcached-1.0/exist.cc \
-                                        tests/libmemcached-1.0/fetch_all_results.cc \
-                                        tests/libmemcached-1.0/generate.cc \
                                         tests/libmemcached-1.0/haldenbrand.cc \
                                         tests/libmemcached-1.0/ketama.cc \
                                         tests/libmemcached-1.0/mem_functions.cc \
@@ -106,7 +106,6 @@ tests_libmemcached_1_0_testsocket_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STR
 tests_libmemcached_1_0_testsocket_SOURCES= \
                                           tests/libmemcached-1.0/all_tests_socket.cc \
                                           tests/libmemcached-1.0/basic.cc \
-                                          tests/libmemcached-1.0/callback_counter.cc \
                                           tests/libmemcached-1.0/callbacks.cc \
                                           tests/libmemcached-1.0/debug.cc \
                                           tests/libmemcached-1.0/deprecated.cc \
@@ -114,8 +113,6 @@ tests_libmemcached_1_0_testsocket_SOURCES= \
                                           tests/libmemcached-1.0/encoding_key.cc \
                                           tests/libmemcached-1.0/error_conditions.cc \
                                           tests/libmemcached-1.0/exist.cc \
-                                          tests/libmemcached-1.0/fetch_all_results.cc \
-                                          tests/libmemcached-1.0/generate.cc \
                                           tests/libmemcached-1.0/haldenbrand.cc \
                                           tests/libmemcached-1.0/ketama.cc \
                                           tests/libmemcached-1.0/mem_functions.cc \
@@ -131,7 +128,11 @@ tests_libmemcached_1_0_testsocket_SOURCES= \
                                           tests/libmemcached-1.0/touch.cc \
                                           tests/libmemcached-1.0/virtual_buckets.cc
 
-tests_libmemcached_1_0_testsocket_SOURCES+= clients/generator.cc clients/execute.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= clients/generator.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= clients/execute.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/generate.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_testsocket_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
 tests_libmemcached_1_0_testsocket_DEPENDENCIES= \
                                                libmemcached/libmemcached.la \
                                                libtest/libtest.la \
@@ -164,7 +165,12 @@ tests_libmemcached_1_0_sasl_SOURCES= \
                                     tests/libmemcached-1.0/replication.cc \
                                     tests/libmemcached-1.0/sasl.cc \
                                     tests/libmemcached-1.0/virtual_buckets.cc
-tests_libmemcached_1_0_sasl_SOURCES+= clients/generator.cc clients/execute.cc
+tests_libmemcached_1_0_sasl_SOURCES+= clients/execute.cc
+tests_libmemcached_1_0_sasl_SOURCES+= clients/generator.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_libmemcached_1_0_sasl_SOURCES+= tests/libmemcached-1.0/generate.cc
+
 tests_libmemcached_1_0_sasl_DEPENDENCIES= \
                                          libmemcached/libmemcached.la \
                                          libtest/libtest.la
@@ -188,7 +194,15 @@ tests_atomsmasher_LDADD= $(tests_atomsmasher_DEPENDENCIES)
 noinst_PROGRAMS+= tests/atomsmasher
 
 tests_testudp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
-tests_testudp_SOURCES= tests/mem_udp.cc
+tests_testudp_SOURCES=
+
+tests_testudp_SOURCES+= tests/mem_udp.cc
+tests_testudp_SOURCES+= clients/execute.cc
+tests_testudp_SOURCES+= clients/generator.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_testudp_SOURCES+= tests/libmemcached-1.0/generate.cc
+
 tests_testudp_DEPENDENCIES= $(TESTS_LDADDS)
 tests_testudp_LDADD= $(tests_testudp_DEPENDENCIES)
 check_PROGRAMS+= tests/testudp
@@ -197,7 +211,15 @@ noinst_PROGRAMS+= tests/testudp
 test-udp: tests/testudp
        @tests/testudp
 
-tests_testplus_SOURCES= tests/libmemcached-1.0/plus.cpp
+tests_testplus_SOURCES=
+
+tests_testplus_SOURCES+= tests/libmemcached-1.0/plus.cpp
+tests_testplus_SOURCES+= clients/execute.cc
+tests_testplus_SOURCES+= clients/generator.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/callback_counter.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/fetch_all_results.cc
+tests_testplus_SOURCES+= tests/libmemcached-1.0/generate.cc
+
 tests_testplus_CXXFLAGS = $(AM_CXXFLAGS) $(NO_EFF_CXX)
 tests_testplus_DEPENDENCIES= $(TESTS_LDADDS)
 tests_testplus_LDADD= $(tests_testplus_DEPENDENCIES)
index 82e69fda4016e1cd7ecaef85d1521796835fe7be..0aacac928c98e11d53ebdbc470c7d2a817bfa19a 100644 (file)
@@ -38,6 +38,8 @@
 
 #pragma once
 
+#include "tests/libmemcached-1.0/generate.h"
+
 class LibmemcachedRunner : public libtest::Runner {
 public:
   test_return_t run(test_callback_fn* func, void *object)
@@ -92,6 +94,7 @@ private:
 
   test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container)
   {
+    cleanup_pairs(NULL);
     if (func)
     {
       return func(container->parent);