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
;
62 world
->test_startup
= (test_callback_fn
)world_test_startup
;
63 world
->flush
= (test_callback_fn
)world_flush
;
64 world
->pre_run
= (test_callback_fn
)world_pre_run
;
65 world
->create
= (test_callback_create_fn
)world_create
;
66 world
->post_run
= (test_callback_fn
)world_post_run
;
67 world
->on_error
= (test_callback_error_fn
)world_on_error
;
68 world
->destroy
= (test_callback_fn
)world_destroy
;
69 world
->runner
= &defualt_libmemcached_runner
;