From: Brian Aker Date: Tue, 28 Jun 2011 23:51:01 +0000 (-0700) Subject: Fix for lp:802952 X-Git-Tag: 0.51~1^2~9^2~13 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=33ffa22a49d355ceea498d14a5da3fe09544308c;p=m6w6%2Flibmemcached Fix for lp:802952 --- 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());