tests/basic.h \
tests/callbacks.h \
tests/debug.h \
+ tests/deprecated.h \
tests/error_conditions.h \
tests/exist.h \
tests/ketama.h \
tests/libmemcached-1.0/dump.h \
tests/namespace.h \
tests/parser.h \
- tests/touch.h \
- tests/deprecated.h \
tests/pool.h \
tests/print.h \
tests/replication.h \
tests/server_add.h \
tests/string.h \
+ tests/touch.h \
tests/virtual_buckets.h
# Test internals
tests_libmemcached_1_0_testapp_CXXFLAGS = $(AM_CXXFLAGS) ${PTHREAD_CFLAGS}
tests_libmemcached_1_0_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING)
tests_libmemcached_1_0_testapp_SOURCES= \
+ tests/libmemcached-1.0/pool.cc \
+ tests/libmemcached-1.0/print.cc \
+ tests/libmemcached-1.0/replication.cc \
tests/libmemcached-1.0/basic.cc \
tests/libmemcached-1.0/callbacks.cc \
tests/libmemcached-1.0/debug.cc \
tests/libmemcached-1.0/ketama.cc \
tests/libmemcached-1.0/mem_functions.cc \
tests/libmemcached-1.0/namespace.cc \
- tests/libmemcached-1.0/pool.cc \
- tests/libmemcached-1.0/print.cc \
- tests/libmemcached-1.0/replication.cc \
tests/libmemcached-1.0/parser.cc \
tests/libmemcached-1.0/server_add.cc \
tests/libmemcached-1.0/touch.cc \
return TEST_SUCCESS;
}
-static test_return_t binary_increment_with_prefix_test(memcached_st *orig_memc)
+static test_return_t binary_increment_with_prefix_test(memcached_st *memc)
{
- memcached_st *memc= memcached_clone(NULL, orig_memc);
-
- test_skip(TEST_SUCCESS, pre_binary(memc));
+ test_skip(true, memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL));
test_compare(MEMCACHED_SUCCESS, memcached_callback_set(memc, MEMCACHED_CALLBACK_PREFIX_KEY, (void *)"namespace:"));
test_literal_param("number"),
1, &new_number));
test_compare(uint64_t(2), new_number);
- memcached_free(memc);
return TEST_SUCCESS;
}
{
for (size_t x= 0; x < 100; ++x)
{
- char key[10];
+ char key[MEMCACHED_MAXIMUM_INTEGER_DISPLAY_LENGTH +1];
int check_length= (size_t)snprintf(key, sizeof(key), "%lu", (unsigned long)x);
test_false((size_t)check_length >= sizeof(key) || check_length < 0);
test_compare(MEMCACHED_SUCCESS,
memcached_mget(memc, (const char**)keys, key_length, max_keys));
+ // One the first run we should get a NOT_FOUND, but on the second some data
+ // should be returned.
test_compare(y ? MEMCACHED_SUCCESS : MEMCACHED_NOTFOUND,
memcached_fetch_execute(memc, callbacks, (void *)&counter, 1));
{"virtual buckets", 0, 0, virtual_bucket_tests},
{"memcached_server_get_last_disconnect", 0, 0, memcached_server_get_last_disconnect_tests},
{"touch", 0, 0, touch_tests},
+ {"touch", (test_callback_fn*)pre_binary, 0, touch_tests},
{0, 0, 0, 0}
};
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);
}
test_compare(MEMCACHED_SUCCESS,
- memcached_touch(memc, test_literal_param("touchkey"), 60 *60));
+ memcached_touch(memc, test_literal_param(__func__), 60 *60));
test_skip(false ,memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL));
- rc= memcached_touch(memc, test_literal_param("touchkey"), 60 *60 *24 *60);
+ rc= memcached_touch(memc, test_literal_param(__func__), 60 *60 *24 *60);
test_compare_hint(MEMCACHED_SUCCESS, rc, memcached_last_error_message(memc));
test_compare(MEMCACHED_NOTFOUND,
- memcached_exist(memc, test_literal_param("touchkey")));
+ memcached_exist(memc, test_literal_param(__func__)));
return TEST_SUCCESS;
}
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);
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);
test_compare(MEMCACHED_SUCCESS,
memcached_touch_by_key(memc,
test_literal_param("grouping_key"),
- test_literal_param("touchkey"),
+ test_literal_param(__func__),
60 *60));
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"),
+ test_literal_param(__func__),
60 *60 *24 *60));
test_compare(MEMCACHED_NOTFOUND,
- memcached_exist_by_key(memc, test_literal_param("grouping_key"),test_literal_param("touchkey")));
+ memcached_exist_by_key(memc, test_literal_param("grouping_key"),test_literal_param(__func__)));
return TEST_SUCCESS;
}