From: Brian Aker Date: Fri, 15 Feb 2013 20:28:00 +0000 (-0500) Subject: Only use touch with the latest version of memcached. X-Git-Tag: 1.0.17~6^2~6 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=b9d04fc670e3b347684081dff7e5bfe28c915594;p=awesomized%2Flibmemcached Only use touch with the latest version of memcached. --- diff --git a/tests/libmemcached-1.0/touch.cc b/tests/libmemcached-1.0/touch.cc index 9ce86f00..a0e1afb3 100644 --- a/tests/libmemcached-1.0/touch.cc +++ b/tests/libmemcached-1.0/touch.cc @@ -88,11 +88,14 @@ test_return_t test_memcached_touch(memcached_st *memc) rc= memcached_touch(memc, test_literal_param(__func__), 60 *60); ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); - rc= memcached_touch(memc, test_literal_param(__func__), 60 *60 *24 *60); - ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); + if (libmemcached_util_version_check(memc, 1, 2, 15)) + { + rc= memcached_touch(memc, test_literal_param(__func__), 60 *60 *24 *60); + ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); - rc= memcached_exist(memc, test_literal_param(__func__)); - ASSERT_EQ_(MEMCACHED_NOTFOUND, rc, "%s", memcached_last_error_message(memc)); + rc= memcached_exist(memc, test_literal_param(__func__)); + ASSERT_EQ_(MEMCACHED_NOTFOUND, rc, "%s", memcached_last_error_message(memc)); + } return TEST_SUCCESS; } @@ -138,14 +141,17 @@ test_return_t test_memcached_touch_by_key(memcached_st *memc) 60 *60); ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); - rc= memcached_touch_by_key(memc, - test_literal_param("grouping_key"), - test_literal_param(__func__), - 60 *60 *24 *60); - ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); + if (libmemcached_util_version_check(memc, 1, 2, 15)) + { + rc= memcached_touch_by_key(memc, + test_literal_param("grouping_key"), + test_literal_param(__func__), + 60 *60 *24 *60); + ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); - rc= memcached_exist_by_key(memc, test_literal_param("grouping_key"),test_literal_param(__func__)); - ASSERT_EQ_(MEMCACHED_NOTFOUND, rc, "%s", memcached_last_error_message(memc)); + rc= memcached_exist_by_key(memc, test_literal_param("grouping_key"),test_literal_param(__func__)); + ASSERT_EQ_(MEMCACHED_NOTFOUND, rc, "%s", memcached_last_error_message(memc)); + } return TEST_SUCCESS; }