Move testing framework out to its own library.
[awesomized/libmemcached] / tests / mem_plus.cc
1 /*
2 C++ to libmemcit
3 */
4 #include <libtest/test.h>
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9
10 #include <libmemcached/memcached.h>
11
12 static test_return_t exists_test(void *obj)
13 {
14 Memcached memc;
15 (void)obj;
16 (void)memc;
17
18 return TEST_SUCCESS;
19 }
20
21 static test_return_t new_test(void *obj)
22 {
23 Memcached *memc= new Memcached;
24 (void)obj;
25
26 (void)memc;
27
28 delete memc;
29
30 return TEST_SUCCESS;
31 }
32
33 static test_return_t copy_test(void *obj)
34 {
35 Memcached *memc= new Memcached;
36 Memcached *copy(memc);
37 (void)obj;
38
39 (void)copy;
40
41 delete memc;
42
43 return TEST_SUCCESS;
44 }
45
46 static test_return_t assign_test(void *obj)
47 {
48 Memcached memc;
49 Memcached copy;
50 (void)obj;
51
52 copy= memc;
53
54 (void)copy;
55
56 return TEST_SUCCESS;
57 }
58
59 test_st basic[] ={
60 { "exists", 0, reinterpret_cast<test_callback_fn>(exists_test) },
61 { "new", 0, reinterpret_cast<test_callback_fn>(new_test) },
62 { "copy", 0, reinterpret_cast<test_callback_fn>(copy_test) },
63 { "assign", 0, reinterpret_cast<test_callback_fn>(assign_test) },
64 { 0, 0, 0}
65 };
66
67 collection_st collection[] ={
68 {"basic", 0, 0, basic},
69 {0, 0, 0, 0}
70 };
71
72 void get_world(world_st *world)
73 {
74 world->collections= collection;
75 }