=== modified file 'tests/libmemcached-1.0/all_tests.h' --- tests/libmemcached-1.0/all_tests.h 2012-05-11 04:19:35 +0000 +++ tests/libmemcached-1.0/all_tests.h 2012-05-11 07:09:16 +0000 @@ -274,6 +274,7 @@ {"lp:490520", true, (test_callback_fn*)regression_bug_490520 }, {"lp:854604", true, (test_callback_fn*)regression_bug_854604 }, {"lp:996813", true, (test_callback_fn*)regression_996813_TEST }, + {"lp:994772", true, (test_callback_fn*)regression_994772_TEST }, {0, false, (test_callback_fn*)0} };
=== modified file 'tests/libmemcached-1.0/mem_functions.cc' --- tests/libmemcached-1.0/mem_functions.cc 2012-05-11 04:19:35 +0000 +++ tests/libmemcached-1.0/mem_functions.cc 2012-05-11 07:09:16 +0000 @@ -4590,6 +4590,46 @@ }
+test_return_t regression_994772_TEST(memcached_st* memc) +{ + test_skip(MEMCACHED_SUCCESS, memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, 1)); + + test_compare(MEMCACHED_SUCCESS, + memcached_set(memc, + test_literal_param(__func__), // Key + test_literal_param(__func__), // Value + time_t(0), uint32_t(0))); + + const char *keys[] = { __func__ }; + size_t key_length[]= { strlen(__func__) }; + test_compare(MEMCACHED_SUCCESS, + memcached_mget(memc, keys, key_length, 1)); + + memcached_return_t rc; + memcached_result_st *results = memcached_fetch_result(memc, NULL, &rc); + test_true(results); + test_compare(MEMCACHED_SUCCESS, rc); + + test_strcmp(__func__, memcached_result_value(results)); + uint64_t cas_value= memcached_result_cas(results); + test_true(cas_value); + + // Bad cas value, sanity check + test_true(cas_value != 9999); + test_compare(MEMCACHED_END, + memcached_cas(memc, + test_literal_param(__func__), // Key + test_literal_param(__FILE__), // Value + time_t(0), uint32_t(0), 9999)); + + test_compare(MEMCACHED_SUCCESS, memcached_set(memc, + "different", strlen("different"), // Key + test_literal_param(__FILE__), // Value + time_t(0), uint32_t(0))); + + return TEST_SUCCESS; +} + test_return_t regression_bug_854604(memcached_st *) { char buffer[1024];
=== modified file 'tests/libmemcached-1.0/mem_functions.h' --- tests/libmemcached-1.0/mem_functions.h 2012-05-11 04:19:35 +0000 +++ tests/libmemcached-1.0/mem_functions.h 2012-05-11 07:09:16 +0000 @@ -175,3 +175,4 @@ test_return_t wrong_failure_counter_two_test(memcached_st *memc); test_return_t kill_HUP_TEST(memcached_st *memc); test_return_t regression_996813_TEST(memcached_st*); +test_return_t regression_994772_TEST(memcached_st*);
=== modified file 'tests/ libmemcached- 1.0/all_ tests.h' hed-1.0/ all_tests. h 2012-05-11 04:19:35 +0000 hed-1.0/ all_tests. h 2012-05-11 07:09:16 +0000 fn*)regression_ bug_490520 }, fn*)regression_ bug_854604 }, fn*)regression_ 996813_ TEST }, fn*)regression_ 994772_ TEST }, fn*)0}
--- tests/libmemcac
+++ tests/libmemcac
@@ -274,6 +274,7 @@
{"lp:490520", true, (test_callback_
{"lp:854604", true, (test_callback_
{"lp:996813", true, (test_callback_
+ {"lp:994772", true, (test_callback_
{0, false, (test_callback_
};
=== modified file 'tests/ libmemcached- 1.0/mem_ functions. cc' hed-1.0/ mem_functions. cc 2012-05-11 04:19:35 +0000 hed-1.0/ mem_functions. cc 2012-05-11 07:09:16 +0000
--- tests/libmemcac
+++ tests/libmemcac
@@ -4590,6 +4590,46 @@
}
+test_return_t regression_ 994772_ TEST(memcached_ st* memc) MEMCACHED_ SUCCESS, memcached_ behavior_ set(memc, MEMCACHED_ BEHAVIOR_ BINARY_ PROTOCOL, 1)); MEMCACHED_ SUCCESS, param(_ _func__ ), // Key param(_ _func__ ), // Value MEMCACHED_ SUCCESS, mget(memc, keys, key_length, 1)); fetch_result( memc, NULL, &rc); MEMCACHED_ SUCCESS, rc); __func_ _, memcached_ result_ value(results) ); result_ cas(results) ; cas_value) ; MEMCACHED_ END, param(_ _func__ ), // Key param(_ _FILE__ ), // Value MEMCACHED_ SUCCESS, memcached_set(memc, "different" ), // Key param(_ _FILE__ ), // Value bug_854604( memcached_ st *)
+{
+ test_skip(
+
+ test_compare(
+ memcached_set(memc,
+ test_literal_
+ test_literal_
+ time_t(0), uint32_t(0)));
+
+ const char *keys[] = { __func__ };
+ size_t key_length[]= { strlen(__func__) };
+ test_compare(
+ memcached_
+
+ memcached_return_t rc;
+ memcached_result_st *results = memcached_
+ test_true(results);
+ test_compare(
+
+ test_strcmp(
+ uint64_t cas_value= memcached_
+ test_true(
+
+ // Bad cas value, sanity check
+ test_true(cas_value != 9999);
+ test_compare(
+ memcached_cas(memc,
+ test_literal_
+ test_literal_
+ time_t(0), uint32_t(0), 9999));
+
+ test_compare(
+ "different", strlen(
+ test_literal_
+ time_t(0), uint32_t(0)));
+
+ return TEST_SUCCESS;
+}
+
test_return_t regression_
{
char buffer[1024];
=== modified file 'tests/ libmemcached- 1.0/mem_ functions. h' hed-1.0/ mem_functions. h 2012-05-11 04:19:35 +0000 hed-1.0/ mem_functions. h 2012-05-11 07:09:16 +0000 counter_ two_test( memcached_ st *memc); TEST(memcached_ st *memc); 996813_ TEST(memcached_ st*); 994772_ TEST(memcached_ st*);
--- tests/libmemcac
+++ tests/libmemcac
@@ -175,3 +175,4 @@
test_return_t wrong_failure_
test_return_t kill_HUP_
test_return_t regression_
+test_return_t regression_