From aabf1841b26ae55d04249bb47b91d76e66635f95 Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Wed, 18 May 2011 17:42:23 -0700 Subject: [PATCH] Added in the better test_compare() --- libtest/test.h | 2 +- tests/mem_functions.cc | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libtest/test.h b/libtest/test.h index 656be169..604e661c 100644 --- a/libtest/test.h +++ b/libtest/test.h @@ -222,7 +222,7 @@ do \ { \ if ((A) != (B)) \ { \ - fprintf(stderr, "\n%s:%d: Expected %lu == %lu\n", __FILE__, __LINE__, (unsigned long)(A), (unsigned long)(B)); \ + fprintf(stderr, "\n%s:%d: Expected %s, got %lu\n", __FILE__, __LINE__, #A, (unsigned long)(B)); \ create_core(); \ return TEST_FAILURE; \ } \ diff --git a/tests/mem_functions.cc b/tests/mem_functions.cc index dd5a2569..ca7fb084 100644 --- a/tests/mem_functions.cc +++ b/tests/mem_functions.cc @@ -2547,10 +2547,9 @@ static test_return_t user_supplied_bug9(memcached_st *memc) for (unsigned int x= 0; x < 3; x++) { - memcached_return_t rc; - rc= memcached_set(memc, keys[x], key_length[x], - keys[x], key_length[x], - (time_t)50, (uint32_t)9); + memcached_return_t rc= memcached_set(memc, keys[x], key_length[x], + keys[x], key_length[x], + (time_t)50, (uint32_t)9); test_true(rc == MEMCACHED_SUCCESS); } @@ -2559,13 +2558,13 @@ static test_return_t user_supplied_bug9(memcached_st *memc) /* We need to empty the server before continueing test */ while ((return_value= memcached_fetch(memc, return_key, &return_key_length, - &return_value_length, &flags, &rc)) != NULL) + &return_value_length, &flags, &rc)) != NULL) { test_true(return_value); free(return_value); count++; } - test_true(count == 3); + test_compare(3, count); return TEST_SUCCESS; } -- 2.30.2