mem_functions.cc | mem_functions.cc | |||
---|---|---|---|---|
skipping to change at line 89 | skipping to change at line 89 | |||
#include <libmemcachedutil-1.0/util.h> | #include <libmemcachedutil-1.0/util.h> | |||
#include "tests/hash_results.h" | #include "tests/hash_results.h" | |||
#include "tests/libmemcached-1.0/callback_counter.h" | #include "tests/libmemcached-1.0/callback_counter.h" | |||
#include "tests/libmemcached-1.0/fetch_all_results.h" | #include "tests/libmemcached-1.0/fetch_all_results.h" | |||
#include "tests/libmemcached-1.0/mem_functions.h" | #include "tests/libmemcached-1.0/mem_functions.h" | |||
#include "tests/libmemcached-1.0/setup_and_teardowns.h" | #include "tests/libmemcached-1.0/setup_and_teardowns.h" | |||
#include "tests/print.h" | #include "tests/print.h" | |||
#include "tests/debug.h" | #include "tests/debug.h" | |||
#include "tests/memc.hpp" | ||||
#define UUID_STRING_MAXLENGTH 36 | #define UUID_STRING_MAXLENGTH 36 | |||
#include "tests/keys.hpp" | #include "tests/keys.hpp" | |||
#include "libmemcached/instance.h" | #include "libmemcached/instance.hpp" | |||
static memcached_st * create_single_instance_memcached(const memcached_st * original_memc, const char *options) | static memcached_st * create_single_instance_memcached(const memcached_st * original_memc, const char *options) | |||
{ | { | |||
/* | /* | |||
If no options are given, copy over at least the binary flag. | If no options are given, copy over at least the binary flag. | |||
*/ | */ | |||
char options_buffer[1024]= { 0 }; | char options_buffer[1024]= { 0 }; | |||
if (options == NULL) | if (options == NULL) | |||
{ | { | |||
if (memcached_is_binary(original_memc)) | if (memcached_is_binary(original_memc)) | |||
skipping to change at line 2751 | skipping to change at line 2752 | |||
test_compare(TEST_SUCCESS, | test_compare(TEST_SUCCESS, | |||
_user_supplied_bug21(memc, 10)); | _user_supplied_bug21(memc, 10)); | |||
/* should fail as of r580 */ | /* should fail as of r580 */ | |||
test_compare(TEST_SUCCESS, | test_compare(TEST_SUCCESS, | |||
_user_supplied_bug21(memc, 1000)); | _user_supplied_bug21(memc, 1000)); | |||
return TEST_SUCCESS; | return TEST_SUCCESS; | |||
} | } | |||
test_return_t ketama_TEST(memcached_st *) | ||||
{ | ||||
test::Memc memc("--server=10.0.1.1:11211 --server=10.0.1.2:11211"); | ||||
test_compare(MEMCACHED_SUCCESS, | ||||
memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_KETAMA_WEIG | ||||
HTED, true)); | ||||
test_compare(memcached_behavior_get(&memc, MEMCACHED_BEHAVIOR_KETAMA_WEIG | ||||
HTED), uint64_t(1)); | ||||
test_compare(memcached_behavior_set(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH | ||||
, MEMCACHED_HASH_MD5), MEMCACHED_SUCCESS); | ||||
test_compare(memcached_behavior_get(&memc, MEMCACHED_BEHAVIOR_KETAMA_HASH | ||||
), MEMCACHED_HASH_MD5); | ||||
test_compare(memcached_behavior_set_distribution(&memc, MEMCACHED_DISTRIB | ||||
UTION_CONSISTENT_KETAMA_SPY), MEMCACHED_SUCCESS); | ||||
return TEST_SUCCESS; | ||||
} | ||||
test_return_t output_ketama_weighted_keys(memcached_st *) | test_return_t output_ketama_weighted_keys(memcached_st *) | |||
{ | { | |||
memcached_st *memc= memcached_create(NULL); | memcached_st *memc= memcached_create(NULL); | |||
test_true(memc); | test_true(memc); | |||
test_compare(MEMCACHED_SUCCESS, | test_compare(MEMCACHED_SUCCESS, | |||
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_KETAMA_WEIGH TED, true)); | memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_KETAMA_WEIGH TED, true)); | |||
uint64_t value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_KETAMA_WE IGHTED); | uint64_t value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_KETAMA_WE IGHTED); | |||
test_compare(value, uint64_t(1)); | test_compare(value, uint64_t(1)); | |||
skipping to change at line 3659 | skipping to change at line 3678 | |||
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) | for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) | |||
{ | { | |||
test_compare(murmur_values[x], | test_compare(murmur_values[x], | |||
memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHE D_HASH_MURMUR)); | memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHE D_HASH_MURMUR)); | |||
} | } | |||
return TEST_SUCCESS; | return TEST_SUCCESS; | |||
#endif | #endif | |||
} | } | |||
test_return_t murmur3_TEST(hashkit_st *) | ||||
{ | ||||
test_skip(true, libhashkit_has_algorithm(HASHKIT_HASH_MURMUR3)); | ||||
#ifdef WORDS_BIGENDIAN | ||||
(void)murmur3_values; | ||||
return TEST_SKIPPED; | ||||
#else | ||||
uint32_t x; | ||||
const char **ptr; | ||||
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) | ||||
{ | ||||
test_compare(murmur3_values[x], | ||||
memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHE | ||||
D_HASH_MURMUR3)); | ||||
} | ||||
return TEST_SUCCESS; | ||||
#endif | ||||
} | ||||
test_return_t jenkins_run (memcached_st *) | test_return_t jenkins_run (memcached_st *) | |||
{ | { | |||
uint32_t x; | uint32_t x; | |||
const char **ptr; | const char **ptr; | |||
for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) | for (ptr= list_to_hash, x= 0; *ptr; ptr++, x++) | |||
{ | { | |||
test_compare(jenkins_values[x], | test_compare(jenkins_values[x], | |||
memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHE D_HASH_JENKINS)); | memcached_generate_hash_value(*ptr, strlen(*ptr), MEMCACHE D_HASH_JENKINS)); | |||
} | } | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 47 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |