X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fmem_functions.c;h=389bfdc13f7e01183917d4afe79ce300fc19a1d3;hb=4aceed329aee349bf8817dd7e420678df97898f0;hp=1ed8731d2acf82078266479e9ac04b468336f33c;hpb=7c1a96232117f7861fe8179baf8f318188356645;p=awesomized%2Flibmemcached diff --git a/tests/mem_functions.c b/tests/mem_functions.c index 1ed8731d..389bfdc1 100644 --- a/tests/mem_functions.c +++ b/tests/mem_functions.c @@ -3476,12 +3476,14 @@ static test_return_t mget_read(memcached_st *memc) { memcached_return_t rc; + if (! libmemcached_util_version_check(memc, 1, 4, 4)) + return TEST_SKIPPED; + rc= memcached_mget(memc, global_keys, global_keys_length, global_count); - if (rc == MEMCACHED_SOME_ERRORS) - { - return TEST_SUCCESS; - } - else if (rc == MEMCACHED_SUCCESS) + + test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc)); + + // Go fetch the keys and test to see if all of them were returned { size_t keys_returned; test_true(fetch_all_results(memc, &keys_returned) == TEST_SUCCESS); @@ -3490,7 +3492,6 @@ static test_return_t mget_read(memcached_st *memc) test_true_got(global_count == keys_returned, buffer); } - test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc)); return TEST_SUCCESS; } @@ -3499,12 +3500,13 @@ static test_return_t mget_read_result(memcached_st *memc) { memcached_return_t rc; - rc= memcached_mget(memc, global_keys, global_keys_length, global_count); + if (! libmemcached_util_version_check(memc, 1, 4, 4)) + return TEST_SKIPPED; - if (rc == MEMCACHED_SOME_ERRORS) - return TEST_SUCCESS; + rc= memcached_mget(memc, global_keys, global_keys_length, global_count); test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc)); + /* Turn this into a help function */ { memcached_result_st results_obj; @@ -3530,10 +3532,10 @@ static test_return_t mget_read_function(memcached_st *memc) size_t counter; memcached_execute_fn callbacks[1]; - rc= memcached_mget(memc, global_keys, global_keys_length, global_count); + if (! libmemcached_util_version_check(memc, 1, 4, 4)) + return TEST_SKIPPED; - if (rc == MEMCACHED_SOME_ERRORS) - return TEST_SUCCESS; + rc= memcached_mget(memc, global_keys, global_keys_length, global_count); test_true_got(rc == MEMCACHED_SUCCESS, memcached_strerror(NULL, rc)); @@ -3670,9 +3672,13 @@ static test_return_t pre_nonblock_binary(memcached_st *memc) static test_return_t pre_murmur(memcached_st *memc) { +#ifdef HAVE_MURMUR_HASH memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_MURMUR); - return TEST_SUCCESS; +#else + (void) memc; + return TEST_SKIPPED; +#endif } static test_return_t pre_jenkins(memcached_st *memc) @@ -4829,6 +4835,19 @@ static test_return_t hsieh_avaibility_test (memcached_st *memc) return TEST_SUCCESS; } +static test_return_t murmur_avaibility_test (memcached_st *memc) +{ + memcached_return_t expected_rc= MEMCACHED_FAILURE; +#ifdef HAVE_MURMUR_HASH + expected_rc= MEMCACHED_SUCCESS; +#endif + memcached_return_t rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, + (uint64_t)MEMCACHED_HASH_MURMUR); + test_true(rc == expected_rc); + + return TEST_SUCCESS; +} + static test_return_t one_at_a_time_run (memcached_st *memc __attribute__((unused))) { uint32_t x; @@ -4961,6 +4980,7 @@ static test_return_t hsieh_run (memcached_st *memc __attribute__((unused))) static test_return_t murmur_run (memcached_st *memc __attribute__((unused))) { #ifdef WORDS_BIGENDIAN + (void)murmur_values; return TEST_SKIPPED; #else uint32_t x; @@ -6389,6 +6409,11 @@ test_st hsieh_availability[] ={ {0, 0, (test_callback_fn)0} }; +test_st murmur_availability[] ={ + {"murmur_avaibility_test", 0, (test_callback_fn)murmur_avaibility_test}, + {0, 0, (test_callback_fn)0} +}; + #if 0 test_st hash_sanity[] ={ {"hash sanity", 0, (test_callback_fn)hash_sanity_test}, @@ -6430,6 +6455,7 @@ collection_st collection[] ={ {"hash_sanity", 0, 0, hash_sanity}, #endif {"hsieh_availability", 0, 0, hsieh_availability}, + {"murmur_availability", 0, 0, murmur_availability}, {"block", 0, 0, tests}, {"binary", (test_callback_fn)pre_binary, 0, tests}, {"nonblock", (test_callback_fn)pre_nonblock, 0, tests},