2 * Copyright (C) 2006-2009 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
13 Sample test application.
16 #include <libmemcached/memcached.h>
21 #include <sys/types.h>
29 test_return_t
set_test(memcached_st
*memc
);
31 test_return_t
set_test(memcached_st
*memc
)
33 memcached_return_t rc
;
34 const char *key
= "foo";
35 const char *value
= "when we sanitize";
37 rc
= memcached_set(memc
, key
, strlen(key
),
39 (time_t)0, (uint32_t)0);
40 test_truth(rc
== MEMCACHED_SUCCESS
|| rc
== MEMCACHED_BUFFERED
);
46 {"set", 1, (test_callback_fn
)set_test
},
50 collection_st collection
[] ={
55 #define SERVERS_TO_CREATE 1
57 #include "libmemcached_world.h"
59 void get_world(world_st
*world
)
61 world
->collections
= collection
;
63 world
->create
= (test_callback_create_fn
)world_create
;
64 world
->destroy
= (test_callback_fn
)world_destroy
;
66 world
->test
.startup
= (test_callback_fn
)world_test_startup
;
67 world
->test
.flush
= (test_callback_fn
)world_flush
;
68 world
->test
.pre_run
= (test_callback_fn
)world_pre_run
;
69 world
->test
.post_run
= (test_callback_fn
)world_post_run
;
70 world
->test
.on_error
= (test_callback_error_fn
)world_on_error
;
72 world
->runner
= &defualt_libmemcached_runner
;