From 560784bd3bc77b292761ef878dfb5f6205054946 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Tue, 17 Apr 2012 00:26:44 -0700 Subject: [PATCH] Update from OSX --- libmemcached/io.cc | 3 +-- tests/libmemcached-1.0/mem_functions.cc | 7 ++++++- tests/runner.h | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libmemcached/io.cc b/libmemcached/io.cc index 309df4c1..e83522b9 100644 --- a/libmemcached/io.cc +++ b/libmemcached/io.cc @@ -203,6 +203,7 @@ static memcached_return_t io_wait(memcached_server_write_instance_st ptr, if (ptr->root->poll_timeout == 0) // Mimic 0 causes timeout behavior (not all platforms do this) { + ptr->io_wait_count.timeouts++; return memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT); } @@ -340,8 +341,6 @@ static bool io_flush(memcached_server_write_instance_st ptr, } else if (rc == MEMCACHED_TIMEOUT) { - ptr->io_wait_count.timeouts++; - error= memcached_set_error(*ptr, MEMCACHED_TIMEOUT, MEMCACHED_AT); return false; } diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index fce23b84..e39c2a8b 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -646,7 +646,12 @@ test_return_t memcached_mget_mixed_memcached_get_TEST(memcached_st *memc) memcached_return_t rc; char *out_value= memcached_get(memc, keys.key_at(which_key), keys.length_at(which_key), &value_length, &flags, &rc); - test_compare(MEMCACHED_SUCCESS, rc); + if (rc == MEMCACHED_NOTFOUND) + { } // It is possible that the value has been purged. + else + { + test_compare_hint(MEMCACHED_SUCCESS, rc, memcached_last_error_message(memc)); + } test_null(out_value); test_zero(value_length); test_zero(flags); diff --git a/tests/runner.h b/tests/runner.h index 0aacac92..deb685af 100644 --- a/tests/runner.h +++ b/tests/runner.h @@ -84,6 +84,8 @@ private: test_return_t _pre_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container) { + test_compare(true, check()); + if (func) { return func(container->parent); @@ -94,7 +96,9 @@ private: test_return_t _post_runner_default(libmemcached_test_callback_fn func, libmemcached_test_container_st *container) { + test_compare(true, check()); cleanup_pairs(NULL); + if (func) { return func(container->parent); -- 2.30.2