37b6260e7fe78460f8067f49db334b6033bd81a0
[awesomized/libmemcached] / tests / plus.cpp
1 /*
2 C++ interface test
3 */
4 #include <assert.h>
5 #include <memcached.h>
6 #include <memcached.hh>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <sys/time.h>
11 #include <sys/types.h>
12 #include <sys/stat.h>
13 #include <unistd.h>
14 #include <time.h>
15
16 #include "test.h"
17
18 uint8_t basic_test(memcached_st *memc)
19 {
20 Memcached foo;
21 char *value_set= "This is some data";
22 char *value;
23 size_t value_length;
24
25 foo.set("mine", value_set, strlen(value_set));
26 value= foo.get("mine", &value_length);
27
28 assert((memcmp(value, value_set, value_length) == 0));
29
30 return 0;
31 }
32
33 test_st tests[] ={
34 {"basic", 0, basic_test },
35 {0, 0, 0}
36 };
37
38 collection_st collection[] ={
39 {"block", 0, 0, tests},
40 {0, 0, 0, 0}
41 };
42
43 collection_st *gets_collections(void)
44 {
45 return collection;
46 }