X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=tests%2Flibmemcached-1.0%2Ftouch.cc;h=08ff68f4a4921add36039560d29ffed6cc75b5d0;hb=c8b9a1330aaf70eb9e820a3a48799c6baf606a4a;hp=50e6a3599b0924ab4896af582d5aa2a55cdd2fd1;hpb=2674b74b067e8578bf323445a88f46bb3fa18ffd;p=awesomized%2Flibmemcached diff --git a/tests/libmemcached-1.0/touch.cc b/tests/libmemcached-1.0/touch.cc index 50e6a359..08ff68f4 100644 --- a/tests/libmemcached-1.0/touch.cc +++ b/tests/libmemcached-1.0/touch.cc @@ -35,7 +35,7 @@ * */ -#include +#include #include using namespace libtest; @@ -48,14 +48,13 @@ using namespace libtest; static test_return_t pre_touch(memcached_st *memc) { test_compare(MEMCACHED_SUCCESS, memcached_version(memc)); - test_skip(true, libmemcached_util_version_check(memc, 1, 4, 8)); + test_skip(true, libmemcached_util_version_check(memc, 1, 4, 15)); return TEST_SUCCESS; } test_return_t test_memcached_touch(memcached_st *memc) { - test_skip(TEST_SUCCESS, pre_touch(memc)); size_t len; @@ -63,20 +62,20 @@ test_return_t test_memcached_touch(memcached_st *memc) memcached_return rc; test_null(memcached_get(memc, - test_literal_param("touchkey"), + test_literal_param(__func__), &len, &flags, &rc)); test_zero(len); test_compare(MEMCACHED_NOTFOUND, rc); test_compare(MEMCACHED_SUCCESS, memcached_set(memc, - test_literal_param("touchkey"), + test_literal_param(__func__), test_literal_param("touchval"), 2, 0)); { char *value= memcached_get(memc, - test_literal_param("touchkey"), + test_literal_param(__func__), &len, &flags, &rc); test_compare(8U, test_literal_param_size("touchval")); test_true(value); @@ -85,23 +84,20 @@ test_return_t test_memcached_touch(memcached_st *memc) free(value); } - test_compare(MEMCACHED_SUCCESS, - memcached_touch(memc, test_literal_param("touchkey"), 60 *60)); - - test_skip(false ,memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); + 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("touchkey"), 60 *60 *24 *60); - test_compare_hint(MEMCACHED_SUCCESS, rc, 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)); - test_compare(MEMCACHED_NOTFOUND, - memcached_exist(memc, test_literal_param("touchkey"))); + rc= memcached_exist(memc, test_literal_param(__func__)); + ASSERT_EQ_(MEMCACHED_NOTFOUND, rc, "%s", memcached_last_error_message(memc)); return TEST_SUCCESS; } test_return_t test_memcached_touch_by_key(memcached_st *memc) { - test_skip(TEST_SUCCESS, pre_touch(memc)); size_t len; @@ -110,7 +106,7 @@ test_return_t test_memcached_touch_by_key(memcached_st *memc) test_null(memcached_get_by_key(memc, test_literal_param("grouping_key"), - test_literal_param("touchkey"), + test_literal_param(__func__), &len, &flags, &rc)); test_zero(len); test_compare(MEMCACHED_NOTFOUND, rc); @@ -118,14 +114,14 @@ test_return_t test_memcached_touch_by_key(memcached_st *memc) test_compare(MEMCACHED_SUCCESS, memcached_set_by_key(memc, test_literal_param("grouping_key"), - test_literal_param("touchkey"), + test_literal_param(__func__), test_literal_param("touchval"), 2, 0)); { char *value= memcached_get_by_key(memc, test_literal_param("grouping_key"), - test_literal_param("touchkey"), + test_literal_param(__func__), &len, &flags, &rc); test_compare(8U, test_literal_param_size("touchval")); test_true(value); @@ -134,20 +130,20 @@ test_return_t test_memcached_touch_by_key(memcached_st *memc) free(value); } - test_compare(MEMCACHED_SUCCESS, - memcached_touch_by_key(memc, - test_literal_param("grouping_key"), - test_literal_param("touchkey"), - 60 *60)); + rc= memcached_touch_by_key(memc, + test_literal_param("grouping_key"), + test_literal_param(__func__), + 60 *60); + ASSERT_EQ_(MEMCACHED_SUCCESS, rc, "%s", memcached_last_error_message(memc)); - test_skip(false ,memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL)); - test_compare(MEMCACHED_SUCCESS, - memcached_touch_by_key(memc, - test_literal_param("grouping_key"), - test_literal_param("touchkey"), - 60 *60 *24 *60)); - test_compare(MEMCACHED_NOTFOUND, - memcached_exist_by_key(memc, test_literal_param("grouping_key"),test_literal_param("touchkey"))); + 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)); return TEST_SUCCESS; }