From: Brian Aker Date: Fri, 15 Jun 2012 19:56:59 +0000 (-0700) Subject: Fix for test case failure. X-Git-Tag: 1.0.9~20 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=d0f9a32dd1442ba083972642d6fed5cd59bce583;p=awesomized%2Flibmemcached Fix for test case failure. --- diff --git a/libtest/memcached.h b/libtest/memcached.h index 405f275f..8a0b1795 100644 --- a/libtest/memcached.h +++ b/libtest/memcached.h @@ -50,3 +50,24 @@ libtest::Server *build_memcached_sasl_socket(const std::string& socket_file, con } +#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 34d5e4b0..78a3c013 100644 --- a/tests/libmemcached-1.0/mem_functions.cc +++ b/tests/libmemcached-1.0/mem_functions.cc @@ -1750,7 +1750,9 @@ 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, memcached_strerror(NULL, rc)); + test_true_got(rc == MEMCACHED_SUCCESS + or rc == MEMCACHED_SERVER_MEMORY_ALLOCATION_FAILURE + or rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE, memcached_strerror(NULL, rc)); } return TEST_SUCCESS;