From 33ffa22a49d355ceea498d14a5da3fe09544308c Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Tue, 28 Jun 2011 16:51:01 -0700 Subject: [PATCH] Fix for lp:802952 --- tests/plus.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/plus.cpp b/tests/plus.cpp index f67fcf27..460166f5 100644 --- a/tests/plus.cpp +++ b/tests/plus.cpp @@ -114,15 +114,16 @@ test_return_t basic_master_key_test(memcached_st *original) populate_vector(value, value_set); - foo.setByKey(master_key_a, key, value, 0, 0); - foo.getByKey(master_key_a, key, test_value); + test_true(foo.setByKey(master_key_a, key, value, 0, 0)); + test_true(foo.getByKey(master_key_a, key, test_value)); - test_true((memcmp(&value[0], &test_value[0], value.size()) == 0)); + test_compare(value.size(), test_value.size()); + test_memcmp(&value[0], &test_value[0], value.size()); test_value.clear(); - foo.getByKey(master_key_b, key, test_value); - test_true((memcmp(&value[0], &test_value[0], value.size()) == 0)); + test_false(foo.getByKey(master_key_b, key, test_value)); + test_compare(0, test_value.size()); return TEST_SUCCESS; } @@ -134,7 +135,7 @@ memcached_return_t callback_counter(const memcached_st *, { unsigned int *counter= static_cast(context); - *counter= *counter + 1; + *counter= *counter +1; return MEMCACHED_SUCCESS; } @@ -175,7 +176,7 @@ test_return_t mget_test(memcached_st *original) test_true(memc.mget(keys)); size_t count= 0; - while ((mc_rc= memc.fetch(return_key, return_value)) == MEMCACHED_SUCCESS) + while (memcached_success(mc_rc= memc.fetch(return_key, return_value))) { test_compare(return_key.length(), return_value.size()); test_memcmp(&return_value[0], return_key.c_str(), return_value.size()); -- 2.30.2