From: Brian Aker Date: Wed, 16 Dec 2009 20:17:21 +0000 (-0800) Subject: First merge of Trond's patches (cherry picking). X-Git-Tag: 0.37~73 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=fa11f4a5d1a9c92eda13f8a5aa11dcff542b8815;p=m6w6%2Flibmemcached First merge of Trond's patches (cherry picking). --- diff --git a/configure.ac b/configure.ac index 7912531e..98557c2f 100644 --- a/configure.ac +++ b/configure.ac @@ -19,7 +19,6 @@ AC_SEARCH_LIBS(gethostbyname, nsl) AC_CHECK_FUNCS_ONCE([getline]) - PANDORA_HAVE_LIBEVENT PANDORA_REQUIRE_PTHREAD PANDORA_CXX_DEMANGLE @@ -36,6 +35,15 @@ ENABLE_DEPRECATED PANDORA_HAVE_LIBINNODB PANDORA_PRINT_CALLSTACK +AC_CHECK_HEADERS([atomic.h]) +AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"], + AC_CHECK_FUNCS(atomic_add_64) + AC_CHECK_FUNCS(atomic_add_32) + AS_IF([test "x$ac_cv_func_atomic_add_64" = "xyes" -a "x$ac_cv_func_atomic_add_32" = "xyes"], + AC_DEFINE([USE_ATOMIC_H], + [1], + [Define to true if you want to use functions from atomic.h]))) + AC_CONFIG_FILES([ Makefile clients/Makefile diff --git a/libmemcached/memcached_behavior.c b/libmemcached/memcached_behavior.c index eb3466ce..37c9f529 100644 --- a/libmemcached/memcached_behavior.c +++ b/libmemcached/memcached_behavior.c @@ -214,7 +214,6 @@ uint64_t memcached_behavior_get(memcached_st *ptr, return ptr->flags.support_cas; case MEMCACHED_BEHAVIOR_CACHE_LOOKUPS: return ptr->flags.use_cache_lookups; - break; case MEMCACHED_BEHAVIOR_NO_BLOCK: return ptr->flags.no_block; case MEMCACHED_BEHAVIOR_BUFFER_REQUESTS: diff --git a/tests/function.c b/tests/function.c index 41a703c0..b7778660 100644 --- a/tests/function.c +++ b/tests/function.c @@ -4241,7 +4241,7 @@ static test_return_t replication_randomize_mget_test(memcached_st *memc) rc= memcached_set(memc, keys[x], len[x], "1", 1, 0, 0); test_truth(rc == MEMCACHED_SUCCESS); } - + memcached_quit(memc); for (int x=0; x< 7; ++x) { @@ -4729,7 +4729,7 @@ static test_return_t crc_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_CRC); - assert(crc_values[x] == hash_val); + test_truth(crc_values[x] == hash_val); } return TEST_SUCCESS; @@ -4745,7 +4745,7 @@ static test_return_t fnv1_64_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_FNV1_64); - assert(fnv1_64_values[x] == hash_val); + test_truth(fnv1_64_values[x] == hash_val); } return TEST_SUCCESS; @@ -4761,7 +4761,7 @@ static test_return_t fnv1a_64_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_FNV1A_64); - assert(fnv1a_64_values[x] == hash_val); + test_truth(fnv1a_64_values[x] == hash_val); } return TEST_SUCCESS; @@ -4778,7 +4778,7 @@ static test_return_t fnv1_32_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_FNV1_32); - assert(fnv1_32_values[x] == hash_val); + test_truth(fnv1_32_values[x] == hash_val); } return TEST_SUCCESS; @@ -4794,7 +4794,7 @@ static test_return_t fnv1a_32_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_FNV1A_32); - assert(fnv1a_32_values[x] == hash_val); + test_truth(fnv1a_32_values[x] == hash_val); } return TEST_SUCCESS; @@ -4810,7 +4810,7 @@ static test_return_t hsieh_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_HSIEH); - assert(hsieh_values[x] == hash_val); + test_truth(hsieh_values[x] == hash_val); } return TEST_SUCCESS; @@ -4818,6 +4818,9 @@ static test_return_t hsieh_run (memcached_st *memc __attribute__((unused))) static test_return_t murmur_run (memcached_st *memc __attribute__((unused))) { +#ifdef __sparc + return TEST_SKIPPED; +#else uint32_t x; const char **ptr; @@ -4826,10 +4829,11 @@ static test_return_t murmur_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_MURMUR); - assert(murmur_values[x] == hash_val); + test_truth(murmur_values[x] == hash_val); } return TEST_SUCCESS; +#endif } static test_return_t jenkins_run (memcached_st *memc __attribute__((unused))) @@ -4843,7 +4847,7 @@ static test_return_t jenkins_run (memcached_st *memc __attribute__((unused))) uint32_t hash_val; hash_val= memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHED_HASH_JENKINS); - assert(jenkins_values[x] == hash_val); + test_truth(jenkins_values[x] == hash_val); } return TEST_SUCCESS; diff --git a/tests/test.c b/tests/test.c index 8f913869..f95141b1 100644 --- a/tests/test.c +++ b/tests/test.c @@ -225,5 +225,5 @@ error: world_stats_print(&stats); - return 0; + return stats.failed == 0 ? 0 : 1; }