From: Eric Bollengier Date: Tue, 15 Apr 2008 18:47:58 +0000 (+0000) Subject: ebl Add program to validate TCDBM lib with accurate mode X-Git-Tag: Release-3.0.0~1547 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=aff3c3a789c1e7454071cf08947267a38ca56bff;p=bacula%2Fbacula 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 --- 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