From aff3c3a789c1e7454071cf08947267a38ca56bff Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 15 Apr 2008 18:47:58 +0000 Subject: [PATCH] ebl Add program to validate TCDBM lib with accurate mode git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6827 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/tools/tcdbtest.c | 75 +++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 bacula/src/tools/tcdbtest.c diff --git a/bacula/src/tools/tcdbtest.c b/bacula/src/tools/tcdbtest.c new file mode 100644 index 0000000000..543526ffd8 --- /dev/null +++ b/bacula/src/tools/tcdbtest.c @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include + +#define NITEMS 5000000 + +int main(int argc, char **argv){ + + TCHDB *hdb; + int ecode; + char *key, *value; + int i; + char save_key[200]; + + /* create the object */ + hdb = tchdbnew(); + + tchdbsetcache(hdb, 5000000); + tchdbtune(hdb, 9000000, -1, 16, 0); + + /* open the database */ + if(!tchdbopen(hdb, "casket.hdb", HDBOWRITER | HDBOCREAT)){ + ecode = tchdbecode(hdb); + fprintf(stderr, "open error: %s\n", tchdberrmsg(ecode)); + } + + for (i=0; i