return TEST_SUCCESS;
}
-static test_return_t enable_consistent(memcached_st *memc)
+static test_return_t enable_consistent_crc(memcached_st *memc)
+{
+ test_return_t rc;
+ memcached_server_distribution_t value= MEMCACHED_DISTRIBUTION_CONSISTENT;
+ memcached_hash_t hash;
+ memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, value);
+ if ((rc= pre_crc(memc)) != TEST_SUCCESS)
+ return rc;
+
+ value= (memcached_server_distribution_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_DISTRIBUTION);
+ test_truth(value == MEMCACHED_DISTRIBUTION_CONSISTENT);
+
+ hash= (memcached_hash_t)memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_HASH);
+
+ if (hash != MEMCACHED_HASH_CRC)
+ return TEST_SKIPPED;
+
+ return TEST_SUCCESS;
+}
+
+static test_return_t enable_consistent_hsieh(memcached_st *memc)
{
test_return_t rc;
memcached_server_distribution_t value= MEMCACHED_DISTRIBUTION_CONSISTENT;
{"unix_socket_nodelay", (test_callback_fn)pre_nodelay, 0, tests},
{"poll_timeout", (test_callback_fn)poll_timeout, 0, tests},
{"gets", (test_callback_fn)enable_cas, 0, tests},
- {"consistent", (test_callback_fn)enable_consistent, 0, tests},
+ {"consistent_crc", (test_callback_fn)enable_consistent_crc, 0, tests},
+ {"consistent_hsieh", (test_callback_fn)enable_consistent_hsieh, 0, tests},
#ifdef MEMCACHED_ENABLE_DEPRECATED
{"deprecated_memory_allocators", (test_callback_fn)deprecated_set_memory_alloc, 0, tests},
#endif
{"generate", 0, 0, generate_tests},
{"generate_hsieh", (test_callback_fn)pre_hsieh, 0, generate_tests},
{"generate_ketama", (test_callback_fn)pre_behavior_ketama, 0, generate_tests},
- {"generate_hsieh_consistent", (test_callback_fn)enable_consistent, 0, generate_tests},
+ {"generate_hsieh_consistent", (test_callback_fn)enable_consistent_hsieh, 0, generate_tests},
{"generate_md5", (test_callback_fn)pre_md5, 0, generate_tests},
{"generate_murmur", (test_callback_fn)pre_murmur, 0, generate_tests},
{"generate_jenkins", (test_callback_fn)pre_jenkins, 0, generate_tests},