#include "test.h"
-void init_test(memcached_st *not_used)
+ #define GLOBAL_COUNT 100000
+ static pairs_st *global_pairs;
+ static char *global_keys[GLOBAL_COUNT];
+ static size_t global_keys_length[GLOBAL_COUNT];
+
+uint8_t init_test(memcached_st *not_used)
{
memcached_st memc;
memcached_result_length(results)));
}
- WATCHPOINT;
memcached_result_free(&results_obj);
- WATCHPOINT;
+
+ return 0;
}
-void mget_result_alloc_test(memcached_st *memc)
+uint8_t mget_result_alloc_test(memcached_st *memc)
{
memcached_return rc;
char *keys[]= {"fudge", "son", "food"};
rc= memcached_string_append(string, buffer, INT64_MAX);
assert(rc == MEMCACHED_MEMORY_ALLOCATION_FAILURE);
memcached_string_free(string);
+
+ return 0;
}
-void generate_data(memcached_st *memc)
++uint8_t generate_data(memcached_st *memc)
+ {
+ unsigned long long x;
+ global_pairs= pairs_generate(GLOBAL_COUNT);
+ execute_set(memc, global_pairs, GLOBAL_COUNT);
+
+ for (x= 0; x < GLOBAL_COUNT; x++)
+ {
+ global_keys[x]= global_pairs[x].key;
+ global_keys_length[x]= global_pairs[x].key_length;
+ }
++
++ return 0;
+ }
+
-void get_read(memcached_st *memc)
++uint8_t get_read(memcached_st *memc)
+ {
+ unsigned int x;
+ memcached_return rc;
+
+ {
+ char *return_value;
+ size_t return_value_length;
+ uint16_t flags;
+
+ for (x= 0; x < GLOBAL_COUNT; x++)
+ {
+ return_value= memcached_get(memc, global_keys[x], global_keys_length[x],
+ &return_value_length, &flags, &rc);
+ /*
+ assert(return_value);
+ assert(rc == MEMCACHED_SUCCESS);
+ */
+ if (rc == MEMCACHED_SUCCESS && return_value)
+ free(return_value);
+ }
+ }
++
++ return 0;
+ }
+
-void mget_read(memcached_st *memc)
++uint8_t mget_read(memcached_st *memc)
+ {
+ memcached_return rc;
+
+ rc= memcached_mget(memc, global_keys, global_keys_length, GLOBAL_COUNT);
+ assert(rc == MEMCACHED_SUCCESS);
+ /* Turn this into a help function */
+ {
+ char return_key[MEMCACHED_MAX_KEY];
+ size_t return_key_length;
+ char *return_value;
+ size_t return_value_length;
+ uint16_t flags;
+
+ while ((return_value= memcached_fetch(memc, return_key, &return_key_length,
+ &return_value_length, &flags, &rc)))
+ {
+ assert(return_value);
+ assert(rc == MEMCACHED_SUCCESS);
+ free(return_value);
+ }
+ }
++
++ return 0;
+ }
+
-void mget_read_result(memcached_st *memc)
++uint8_t mget_read_result(memcached_st *memc)
+ {
+ memcached_return rc;
+
+ rc= memcached_mget(memc, global_keys, global_keys_length, GLOBAL_COUNT);
+ assert(rc == MEMCACHED_SUCCESS);
+ /* Turn this into a help function */
+ {
+ memcached_result_st results_obj;
+ memcached_result_st *results;
+
+ results= memcached_result_create(memc, &results_obj);
+
+ while ((results= memcached_fetch_result(memc, &results_obj, &rc)))
+ {
+ assert(results);
+ assert(rc == MEMCACHED_SUCCESS);
+ }
+
+ memcached_result_free(&results_obj);
+ }
++
++ return 0;
+ }
+
-void free_data(memcached_st *memc)
++uint8_t free_data(memcached_st *memc)
+ {
+ pairs_free(global_pairs);
++
++ return 0;
+ }
+
-void add_host_test1(memcached_st *memc)
+uint8_t add_host_test1(memcached_st *memc)
{
unsigned int x;
memcached_return rc;