static char *global_keys[GLOBAL_COUNT];
static size_t global_keys_length[GLOBAL_COUNT];
-uint8_t init_test(memcached_st *not_used)
+test_return init_test(memcached_st *not_used)
{
memcached_st memc;
return 0;
}
-uint8_t server_list_null_test(memcached_st *ptr)
+test_return server_list_null_test(memcached_st *ptr)
{
memcached_server_st *server_list;
memcached_return rc;
return MEMCACHED_SUCCESS;
}
-uint8_t server_sort_test(memcached_st *ptr)
+test_return server_sort_test(memcached_st *ptr)
{
uint8_t x;
uint32_t bigger= 0; /* Prime the value for the assert in server_display_function */
return MEMCACHED_SUCCESS;
}
-uint8_t server_unsort_test(memcached_st *ptr)
+test_return server_unsort_test(memcached_st *ptr)
{
uint8_t x;
uint32_t counter= 0; /* Prime the value for the assert in server_display_function */
return 0;
}
-uint8_t allocation_test(memcached_st *not_used)
+test_return allocation_test(memcached_st *not_used)
{
memcached_st *memc;
memc= memcached_create(NULL);
return 0;
}
-uint8_t clone_test(memcached_st *memc)
+test_return clone_test(memcached_st *memc)
{
/* All null? */
{
return 0;
}
-uint8_t connection_test(memcached_st *memc)
+test_return connection_test(memcached_st *memc)
{
memcached_return rc;
return 0;
}
-uint8_t error_test(memcached_st *memc)
+test_return error_test(memcached_st *memc)
{
memcached_return rc;
return 0;
}
-uint8_t set_test(memcached_st *memc)
+test_return set_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t append_test(memcached_st *memc)
+test_return append_test(memcached_st *memc)
{
memcached_return rc;
char *key= "fig";
return 0;
}
-uint8_t append_binary_test(memcached_st *memc)
+test_return append_binary_test(memcached_st *memc)
{
memcached_return rc;
char *key= "numbers";
return 0;
}
-uint8_t cas2_test(memcached_st *memc)
+test_return cas2_test(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
return 0;
}
-uint8_t cas_test(memcached_st *memc)
+test_return cas_test(memcached_st *memc)
{
memcached_return rc;
char *key= "fun";
return 0;
}
-uint8_t prepend_test(memcached_st *memc)
+test_return prepend_test(memcached_st *memc)
{
memcached_return rc;
char *key= "fig";
Set the value, then quit to make sure it is flushed.
Come back in and test that add fails.
*/
-uint8_t add_test(memcached_st *memc)
+test_return add_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
/* Too many broken OS'es have broken loopback in async, so we can't be sure of the result */
if (setting_value)
- assert(rc == MEMCACHED_NOTSTORED || MEMCACHED_STORED);
+ assert(rc == MEMCACHED_NOTSTORED || rc == MEMCACHED_STORED);
else
assert(rc == MEMCACHED_NOTSTORED);
return 0;
}
-uint8_t add_wrapper(memcached_st *memc)
+test_return add_wrapper(memcached_st *memc)
{
unsigned int x;
return 0;
}
-uint8_t replace_test(memcached_st *memc)
+test_return replace_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t delete_test(memcached_st *memc)
+test_return delete_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t flush_test(memcached_st *memc)
+test_return flush_test(memcached_st *memc)
{
memcached_return rc;
return MEMCACHED_SUCCESS;
}
-uint8_t memcached_server_cursor_test(memcached_st *memc)
+test_return memcached_server_cursor_test(memcached_st *memc)
{
char *context= "foo bad";
memcached_server_function callbacks[1];
return 0;
}
-uint8_t bad_key_test(memcached_st *memc)
+test_return bad_key_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo bad";
return memcached_result_set_value(result, READ_THROUGH_VALUE, strlen(READ_THROUGH_VALUE));
}
-uint8_t read_through(memcached_st *memc)
+test_return read_through(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return MEMCACHED_SUCCESS;
}
-uint8_t delete_through(memcached_st *memc)
+test_return delete_through(memcached_st *memc)
{
memcached_trigger_delete_key callback;
memcached_return rc;
return 0;
}
-uint8_t get_test(memcached_st *memc)
+test_return get_test(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t get_test2(memcached_st *memc)
+test_return get_test2(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t set_test2(memcached_st *memc)
+test_return set_test2(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t set_test3(memcached_st *memc)
+test_return set_test3(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t get_test3(memcached_st *memc)
+test_return get_test3(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
return 0;
}
-uint8_t get_test4(memcached_st *memc)
+test_return get_test4(memcached_st *memc)
{
memcached_return rc;
char *key= "foo";
}
/* Do not copy the style of this code, I just access hosts to testthis function */
-uint8_t stats_servername_test(memcached_st *memc)
+test_return stats_servername_test(memcached_st *memc)
{
memcached_return rc;
memcached_stat_st stat;
return 0;
}
-uint8_t increment_test(memcached_st *memc)
+test_return increment_test(memcached_st *memc)
{
uint64_t new_number;
memcached_return rc;
return 0;
}
-uint8_t decrement_test(memcached_st *memc)
+test_return decrement_test(memcached_st *memc)
{
uint64_t new_number;
memcached_return rc;
return 0;
}
-uint8_t quit_test(memcached_st *memc)
+test_return quit_test(memcached_st *memc)
{
memcached_return rc;
char *key= "fudge";
return 0;
}
-uint8_t mget_result_test(memcached_st *memc)
+test_return mget_result_test(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
return 0;
}
-uint8_t mget_result_alloc_test(memcached_st *memc)
+test_return mget_result_alloc_test(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
return 0;
}
-uint8_t mget_result_function(memcached_st *memc)
+test_return mget_result_function(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
return 0;
}
-uint8_t mget_test(memcached_st *memc)
+test_return mget_test(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
return 0;
}
-uint8_t get_stats_keys(memcached_st *memc)
+test_return get_stats_keys(memcached_st *memc)
{
char **list;
char **ptr;
return 0;
}
-uint8_t version_string_test(memcached_st *memc)
+test_return version_string_test(memcached_st *memc)
{
const char *version_string;
return 0;
}
-uint8_t get_stats(memcached_st *memc)
+test_return get_stats(memcached_st *memc)
{
unsigned int x;
char **list;
return 0;
}
-uint8_t add_host_test(memcached_st *memc)
+test_return add_host_test(memcached_st *memc)
{
unsigned int x;
memcached_server_st *servers;
return MEMCACHED_SUCCESS;
}
-uint8_t callback_test(memcached_st *memc)
+test_return callback_test(memcached_st *memc)
{
/* Test User Data */
{
}
/* We don't test the behavior itself, we test the switches */
-uint8_t behavior_test(memcached_st *memc)
+test_return behavior_test(memcached_st *memc)
{
unsigned long long value;
unsigned int set= 1;
}
/* Test case provided by Cal Haldenbrand */
-uint8_t user_supplied_bug1(memcached_st *memc)
+test_return user_supplied_bug1(memcached_st *memc)
{
unsigned int setter= 1;
unsigned int x;
}
/* Test case provided by Cal Haldenbrand */
-uint8_t user_supplied_bug2(memcached_st *memc)
+test_return user_supplied_bug2(memcached_st *memc)
{
int errors;
unsigned int setter;
/* Do a large mget() over all the keys we think exist */
#define KEY_COUNT 3000 // * 1024576
-uint8_t user_supplied_bug3(memcached_st *memc)
+test_return user_supplied_bug3(memcached_st *memc)
{
memcached_return rc;
unsigned int setter;
}
/* Make sure we behave properly if server list has no values */
-uint8_t user_supplied_bug4(memcached_st *memc)
+test_return user_supplied_bug4(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
}
#define VALUE_SIZE_BUG5 1048064
-uint8_t user_supplied_bug5(memcached_st *memc)
+test_return user_supplied_bug5(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"};
return 0;
}
-uint8_t user_supplied_bug6(memcached_st *memc)
+test_return user_supplied_bug6(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"036790384900", "036790384902", "036790384904", "036790384906"};
return 0;
}
-uint8_t user_supplied_bug8(memcached_st *memc)
+test_return user_supplied_bug8(memcached_st *memc)
{
memcached_return rc;
memcached_st *mine;
}
/* Test flag store/retrieve */
-uint8_t user_supplied_bug7(memcached_st *memc)
+test_return user_supplied_bug7(memcached_st *memc)
{
memcached_return rc;
char *keys= "036790384900";
return 0;
}
-uint8_t user_supplied_bug9(memcached_st *memc)
+test_return user_supplied_bug9(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"UDATA:edevil@sapo.pt", "fudge&*@#", "for^#@&$not"};
}
/* We are testing with aggressive timeout to get failures */
-uint8_t user_supplied_bug10(memcached_st *memc)
+test_return user_supplied_bug10(memcached_st *memc)
{
char *key= "foo";
char *value;
/*
We are looking failures in the async protocol
*/
-uint8_t user_supplied_bug11(memcached_st *memc)
+test_return user_supplied_bug11(memcached_st *memc)
{
char *key= "foo";
char *value;
/*
Bug found where incr was not returning MEMCACHED_NOTFOUND when object did not exist.
*/
-uint8_t user_supplied_bug12(memcached_st *memc)
+test_return user_supplied_bug12(memcached_st *memc)
{
memcached_return rc;
uint32_t flags;
Bug found where command total one more than MEMCACHED_MAX_BUFFER
set key34567890 0 0 8169 \r\n is sent followed by buffer of size 8169, followed by 8169
*/
-uint8_t user_supplied_bug13(memcached_st *memc)
+test_return user_supplied_bug13(memcached_st *memc)
{
char key[] = "key34567890";
char *overflow;
set key34567890 0 0 8169 \r\n
is sent followed by buffer of size 8169, followed by 8169
*/
-uint8_t user_supplied_bug14(memcached_st *memc)
+test_return user_supplied_bug14(memcached_st *memc)
{
int setter= 1;
memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, setter);
/*
Look for zero length value problems
*/
-uint8_t user_supplied_bug15(memcached_st *memc)
+test_return user_supplied_bug15(memcached_st *memc)
{
uint32_t x;
memcached_return rc;
return 0;
}
-uint8_t result_static(memcached_st *memc)
+test_return result_static(memcached_st *memc)
{
memcached_result_st result;
memcached_result_st *result_ptr;
return 0;
}
-uint8_t result_alloc(memcached_st *memc)
+test_return result_alloc(memcached_st *memc)
{
memcached_result_st *result;
return 0;
}
-uint8_t string_static_null(memcached_st *memc)
+test_return string_static_null(memcached_st *memc)
{
memcached_string_st string;
memcached_string_st *string_ptr;
return 0;
}
-uint8_t string_alloc_null(memcached_st *memc)
+test_return string_alloc_null(memcached_st *memc)
{
memcached_string_st *string;
return 0;
}
-uint8_t string_alloc_with_size(memcached_st *memc)
+test_return string_alloc_with_size(memcached_st *memc)
{
memcached_string_st *string;
return 0;
}
-uint8_t string_alloc_with_size_toobig(memcached_st *memc)
+test_return string_alloc_with_size_toobig(memcached_st *memc)
{
memcached_string_st *string;
return 0;
}
-uint8_t string_alloc_append(memcached_st *memc)
+test_return string_alloc_append(memcached_st *memc)
{
unsigned int x;
char buffer[SMALL_STRING_LEN];
return 0;
}
-uint8_t string_alloc_append_toobig(memcached_st *memc)
+test_return string_alloc_append_toobig(memcached_st *memc)
{
memcached_return rc;
unsigned int x;
return 0;
}
-uint8_t cleanup_pairs(memcached_st *memc)
+test_return cleanup_pairs(memcached_st *memc)
{
pairs_free(global_pairs);
return 0;
}
-uint8_t generate_pairs(memcached_st *memc)
+test_return generate_pairs(memcached_st *memc)
{
unsigned long long x;
global_pairs= pairs_generate(GLOBAL_COUNT, 400);
return 0;
}
-uint8_t generate_large_pairs(memcached_st *memc)
+test_return generate_large_pairs(memcached_st *memc)
{
unsigned long long x;
global_pairs= pairs_generate(GLOBAL2_COUNT, MEMCACHED_MAX_BUFFER+10);
return 0;
}
-uint8_t generate_data(memcached_st *memc)
+test_return generate_data(memcached_st *memc)
{
execute_set(memc, global_pairs, global_count);
return 0;
}
-uint8_t generate_buffer_data(memcached_st *memc)
+test_return generate_buffer_data(memcached_st *memc)
{
int latch= 0;
return 0;
}
-uint8_t get_read(memcached_st *memc)
+test_return get_read(memcached_st *memc)
{
unsigned int x;
memcached_return rc;
return 0;
}
-uint8_t mget_read(memcached_st *memc)
+test_return mget_read(memcached_st *memc)
{
memcached_return rc;
return 0;
}
-uint8_t mget_read_result(memcached_st *memc)
+test_return mget_read_result(memcached_st *memc)
{
memcached_return rc;
return 0;
}
-uint8_t mget_read_function(memcached_st *memc)
+test_return mget_read_function(memcached_st *memc)
{
memcached_return rc;
unsigned int counter;
return 0;
}
-uint8_t delete_generate(memcached_st *memc)
+test_return delete_generate(memcached_st *memc)
{
unsigned int x;
return 0;
}
-uint8_t delete_buffer_generate(memcached_st *memc)
+test_return delete_buffer_generate(memcached_st *memc)
{
int latch= 0;
unsigned int x;
return 0;
}
-uint8_t free_data(memcached_st *memc)
+test_return free_data(memcached_st *memc)
{
pairs_free(global_pairs);
return 0;
}
-uint8_t add_host_test1(memcached_st *memc)
+test_return add_host_test1(memcached_st *memc)
{
unsigned int x;
memcached_return rc;
return MEMCACHED_SUCCESS;
}
-memcached_return pre_hash_ketama(memcached_st *memc)
+memcached_return pre_behavior_ketama(memcached_st *memc)
{
- memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_HASH, (uint64_t)MEMCACHED_HASH_KETAMA);
+ memcached_return rc;
+ uint64_t value;
+
+ rc= memcached_behavior_set(memc, MEMCACHED_BEHAVIOR_KETAMA, 1);
+ assert(rc == MEMCACHED_SUCCESS);
+
+ value= memcached_behavior_get(memc, MEMCACHED_BEHAVIOR_KETAMA);
+ assert(value == 1);
return MEMCACHED_SUCCESS;
}
{"fnv1a_64", pre_hash_fnv1a_64, 0, tests},
{"fnv1_32", pre_hash_fnv1_32, 0, tests},
{"fnv1a_32", pre_hash_fnv1a_32, 0, tests},
- {"ketama", pre_hash_ketama, 0, tests},
+ {"ketama", pre_behavior_ketama, 0, tests},
{"unix_socket", pre_unix_socket, 0, tests},
{"unix_socket_nodelay", pre_nodelay, 0, tests},
{"poll_timeout", poll_timeout, 0, tests},