1 /**Some common functions in use for testing framework*/
3 /***************************************************************************
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the BSD License (revised). *
8 ***************************************************************************/
43 #include <kdbloader.h>
44 #include <kdbbackend.h>
46 #define KEY_ROOT "user/tests"
47 #define KEY_LENGTH 1024
48 #define BUFFER_LENGTH 4096
56 extern int nbStreaming;
62 KSFromXMLfile ksFromXMLfile;
69 #define warn_if_fail(x,y) {nbTest++; if (!(x)) { printf("%s:%d: warn in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y); }}
70 #define succeed_if(x,y) {nbTest++; if (!(x)) { nbError++; printf("%s:%d: error in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y); }}
71 #define exit_if_fail(x,y) {nbTest++; if (!(x)) { printf("%s:%d: fatal in %s: %s\n", __FILE__, __LINE__, __FUNCTION__, y); exit(1); }}
73 int compare_key (Key *k1, Key *k2, KDBCap *cap);
74 int compare_keyset (KeySet *ks, KeySet *ks2, int filter, KDBCap *cap);
75 int compare_files (const char * filename);
77 int loadToolsLib(void);
78 char *srcdir_file(const char * fileName);
80 Key * create_root_key (const char *backendName);
81 KeySet *create_conf (const char *filename);