Line data Source code
1 : #include "../common/tdb_private.h" 2 : #include "../common/io.c" 3 : #include "../common/tdb.c" 4 : #include "../common/lock.c" 5 : #include "../common/freelist.c" 6 : #include "../common/traverse.c" 7 : #include "../common/transaction.c" 8 : #include "../common/error.c" 9 : #include "../common/open.c" 10 : #include "../common/check.c" 11 : #include "../common/hash.c" 12 : #include "../common/mutex.c" 13 : #include "tap-interface.h" 14 : #include <stdlib.h> 15 : #include "logging.h" 16 : 17 1 : int main(int argc, char *argv[]) 18 : { 19 : struct tdb_context *tdb; 20 : TDB_DATA key; 21 : 22 : plan_tests(3); 23 1 : tdb = tdb_open_ex( 24 : "test/circular_chain.tdb", 25 : 0, 26 : TDB_DEFAULT, 27 : O_RDONLY, 28 : 0600, 29 : &taplogctx, 30 : NULL); 31 : 32 1 : ok1(tdb); 33 1 : key.dsize = strlen("x"); 34 1 : key.dptr = discard_const_p(uint8_t, "x"); 35 : 36 1 : ok1(tdb_exists(tdb, key) == 0); 37 1 : ok1(tdb_error(tdb) == TDB_ERR_CORRUPT); 38 : 39 1 : tdb_close(tdb); 40 : 41 1 : return exit_status(); 42 : }