From: Brian Aker Date: Sun, 17 Jun 2012 21:21:38 +0000 (-0700) Subject: Additional cleanup X-Git-Tag: 1.0.9~19 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=9a9d6492357025e57ce7779c801e41dcc01f6f69;p=awesomized%2Flibmemcached Additional cleanup --- diff --git a/libtest/comparison.hpp b/libtest/comparison.hpp index 63bd08a2..aecf05f0 100644 --- a/libtest/comparison.hpp +++ b/libtest/comparison.hpp @@ -41,6 +41,7 @@ #if defined(HAVE_LIBMEMCACHED) && HAVE_LIBMEMCACHED #include #include +#include #endif #if defined(HAVE_LIBGEARMAN) && HAVE_LIBGEARMAN diff --git a/libtest/include.am b/libtest/include.am index 8d2694bc..157537b4 100644 --- a/libtest/include.am +++ b/libtest/include.am @@ -70,6 +70,7 @@ noinst_HEADERS+= libtest/is_local.hpp noinst_HEADERS+= libtest/killpid.h noinst_HEADERS+= libtest/libtool.hpp noinst_HEADERS+= libtest/memcached.h +noinst_HEADERS+= libtest/memcached.hpp noinst_HEADERS+= libtest/poll_error.hpp noinst_HEADERS+= libtest/port.h noinst_HEADERS+= libtest/runner.h diff --git a/libtest/memcached.h b/libtest/memcached.h index 8a0b1795..915d3fa8 100644 --- a/libtest/memcached.h +++ b/libtest/memcached.h @@ -49,25 +49,3 @@ libtest::Server *build_memcached_sasl(const std::string& hostname, const in_port libtest::Server *build_memcached_sasl_socket(const std::string& socket_file, const in_port_t try_port, const std::string& username, const std::string& password); } - -#if defined(LIBMEMCACHED) && LIBMEMCACHED -bool operator== (const memcached_st&c memc, const memcached_return_t rc) -{ - if (memcached_last_error(&memc) == rc) - { - return true; - } - - return false; -} - -bool operator!= (const memcached_st&c memc, const memcached_return_t rc) -{ - if (memcached_last_error(&memc) != rc) - { - return true; - } - - return false; -} -#endif diff --git a/tests/libmemcached-1.0/mem_functions.cc b/tests/libmemcached-1.0/mem_functions.cc index 78a3c013..77b4a481 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -52,6 +52,8 @@ #include +#include + #include #include #include @@ -1750,9 +1752,8 @@ test_return_t block_add_regression(memcached_st *memc) global_pairs[x].key, global_pairs[x].key_length, &blob[0], blob.size(), time_t(0), uint32_t(0)); - test_true_got(rc == MEMCACHED_SUCCESS - or rc == MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE - or rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE, memcached_strerror(NULL, rc)); + test_compare(*memc, MEMCACHED_SUCCESS); + test_compare(rc, MEMCACHED_SUCCESS); } return TEST_SUCCESS; @@ -1761,9 +1762,7 @@ test_return_t block_add_regression(memcached_st *memc) test_return_t binary_add_regression(memcached_st *memc) { test_skip(MEMCACHED_SUCCESS, memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, true)); - test_return_t rc= block_add_regression(memc); - - return rc; + return block_add_regression(memc); } test_return_t get_stats_keys(memcached_st *memc)