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