From: Brian Aker Date: Fri, 18 Dec 2009 21:49:37 +0000 (-0800) Subject: Merge code fix for replication non-block test failing instead of skipping on X-Git-Tag: 0.37~54 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3936140765093cf4e3b28e0a4b837a67b79c1cbf;p=m6w6%2Flibmemcached Merge code fix for replication non-block test failing instead of skipping on old versions. --- diff --git a/tests/function.c b/tests/function.c index 8160dadb..fadd41cd 100644 --- a/tests/function.c +++ b/tests/function.c @@ -3521,6 +3521,7 @@ static test_return_t pre_binary(memcached_st *memc) return rc == MEMCACHED_SUCCESS ? TEST_SUCCESS : TEST_SKIPPED; } + static test_return_t pre_replication(memcached_st *memc) { test_return_t test_rc; @@ -3542,16 +3543,21 @@ static test_return_t pre_replication(memcached_st *memc) return rc == MEMCACHED_SUCCESS ? TEST_SUCCESS : TEST_SKIPPED; } + static test_return_t pre_replication_noblock(memcached_st *memc) { - test_return_t rc= MEMCACHED_FAILURE; - if (pre_replication(memc) == TEST_SUCCESS && - pre_nonblock(memc) == TEST_SUCCESS) - rc= TEST_SUCCESS; + test_return_t rc; + + rc= pre_replication(memc); + if (rc != TEST_SUCCESS) + return rc; + + rc= pre_nonblock(memc); return rc; } + static void my_free(memcached_st *ptr __attribute__((unused)), void *mem) { #ifdef HARD_MALLOC_TESTS @@ -3562,6 +3568,7 @@ static void my_free(memcached_st *ptr __attribute__((unused)), void *mem) #endif } + static void *my_malloc(memcached_st *ptr __attribute__((unused)), const size_t size) { #ifdef HARD_MALLOC_TESTS @@ -3582,6 +3589,7 @@ static void *my_malloc(memcached_st *ptr __attribute__((unused)), const size_t s return ret; } + static void *my_realloc(memcached_st *ptr __attribute__((unused)), void *mem, const size_t size) { #ifdef HARD_MALLOC_TESTS @@ -3600,6 +3608,7 @@ static void *my_realloc(memcached_st *ptr __attribute__((unused)), void *mem, co #endif } + static void *my_calloc(memcached_st *ptr __attribute__((unused)), size_t nelem, const size_t size) { #ifdef HARD_MALLOC_TESTS @@ -3615,6 +3624,7 @@ static void *my_calloc(memcached_st *ptr __attribute__((unused)), size_t nelem, #endif } + static test_return_t set_prefix(memcached_st *memc) { memcached_return_t rc; @@ -3684,6 +3694,7 @@ static test_return_t set_prefix(memcached_st *memc) return TEST_SUCCESS; } + #ifdef MEMCACHED_ENABLE_DEPRECATED static test_return_t deprecated_set_memory_alloc(memcached_st *memc) { @@ -3732,6 +3743,7 @@ static test_return_t deprecated_set_memory_alloc(memcached_st *memc) } #endif + static test_return_t set_memory_alloc(memcached_st *memc) { memcached_return_t rc; diff --git a/tests/test.c b/tests/test.c index 793bcbd7..44f18eea 100644 --- a/tests/test.c +++ b/tests/test.c @@ -42,7 +42,7 @@ static long int timedif(struct timeval a, struct timeval b) return s + us; } -static const char *test_strerror(test_return_t code) +const char *test_strerror(test_return_t code) { switch (code) { case TEST_SUCCESS: diff --git a/tests/test.h b/tests/test.h index d74038c2..302a0907 100644 --- a/tests/test.h +++ b/tests/test.h @@ -122,6 +122,11 @@ void get_world(world_st *world); void create_core(void); +/** + @note Friendly print function for errors. +*/ +const char *test_strerror(test_return_t code); + #define test_truth(A) \ do \ { \