X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Ffunction.c;h=2b01a268dd70354cd686ffaf9ff3e06d04a6cf53;hb=beda55e1f1e2cba7e647e2dea4c86f536052f2cb;hp=a1c817a4a3c08bcd8475797281492d3e2ef67cb8;hpb=6dab216a486ce3c5cb9a041f91bedb88afc8515a;p=m6w6%2Flibmemcached diff --git a/tests/function.c b/tests/function.c index a1c817a4..2b01a268 100644 --- a/tests/function.c +++ b/tests/function.c @@ -11,6 +11,7 @@ #include #include #include +#include "server.h" #include "../lib/common.h" #include "../src/generator.h" #include "../src/execute.h" @@ -1700,8 +1701,7 @@ uint8_t user_supplied_bug13(memcached_st *memc) Test values of many different sizes 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 + is sent followed by buffer of size 8169, followed by 8169 */ uint8_t user_supplied_bug14(memcached_st *memc) { @@ -1723,7 +1723,7 @@ uint8_t user_supplied_bug14(memcached_st *memc) for (x= 0; x < value_length; x++) value[x] = (char) (x % 127); - for (current_length = 0; current_length < value_length; current_length++) + for (current_length= 1; current_length < value_length; current_length++) { rc= memcached_set(memc, key, strlen(key), value, current_length, @@ -2441,7 +2441,34 @@ collection_st collection[] ={ {0, 0, 0, 0} }; -collection_st *gets_collections(void) +#define SERVERS_TO_CREATE 5 + +void *world_create(void) +{ + server_startup_st *construct; + + construct= (server_startup_st *)malloc(sizeof(server_startup_st)); + memset(construct, 0, sizeof(server_startup_st)); + construct->count= SERVERS_TO_CREATE; + construct->udp= 0; + server_startup(construct); + + return construct; +} + +void world_destroy(void *p) +{ + server_startup_st *construct= (server_startup_st *)p; + memcached_server_st *servers= (memcached_server_st *)construct->servers; + memcached_server_list_free(servers); + + server_shutdown(construct); + free(construct); +} + +void get_world(world_st *world) { - return collection; + world->collections= collection; + world->create= world_create; + world->destroy= world_destroy; }