1 #define _XOPEN_SOURCE 500
2 #include <ccan/tdb/tdb.h>
3 #include <ccan/tdb/io.c>
4 #include <ccan/tdb/tdb.c>
5 #include <ccan/tdb/lock.c>
6 #include <ccan/tdb/freelist.c>
7 #include <ccan/tdb/traverse.c>
8 #include <ccan/tdb/transaction.c>
9 #include <ccan/tdb/error.c>
10 #include <ccan/tdb/open.c>
11 #include <ccan/tdb/check.c>
12 #include <ccan/tap/tap.h>
17 int main(int argc, char *argv[])
19 struct tdb_context *tdb;
23 tdb = tdb_open_ex(NULL, 1024, TDB_INTERNAL, O_CREAT|O_TRUNC|O_RDWR,
24 0600, &taplogctx, NULL);
27 /* Tickle bug on appending zero length buffer to zero length buffer. */
28 key.dsize = strlen("hi");
29 key.dptr = (void *)"hi";
30 data.dptr = (void *)"world";
33 ok1(tdb_append(tdb, key, data) == 0);
34 ok1(tdb_append(tdb, key, data) == 0);
35 data = tdb_fetch(tdb, key);