5 #include <memcached.hh>
10 #include <sys/types.h>
18 uint8_t basic_test(memcached_st
*memc
)
21 char *value_set
= "This is some data";
25 foo
.set("mine", value_set
, strlen(value_set
));
26 value
= foo
.get("mine", &value_length
);
28 assert((memcmp(value
, value_set
, value_length
) == 0));
34 {"basic", 0, basic_test
},
38 collection_st collection
[] ={
39 {"block", 0, 0, tests
},
43 #define SERVERS_TO_CREATE 1
45 void *world_create(void)
48 memcached_server_st
*servers
;
49 server_startup_st
*construct
;
51 construct
= (server_startup_st
*)malloc(sizeof(server_startup_st
));
52 memset(construct
, 0, sizeof(server_startup_st
));
54 construct
->count
= SERVERS_TO_CREATE
;
55 server_startup(construct
);
60 void world_destroy(void *p
)
62 server_startup_st
*construct
= (server_startup_st
*)p
;
63 memcached_server_st
*servers
= (memcached_server_st
*)construct
->servers
;
64 memcached_server_list_free(servers
);
66 server_shutdown(construct
);
70 void get_world(world_st
*world
)
72 world
->collections
= collection
;
73 world
->create
= world_create
;
74 world
->destroy
= world_destroy
;