uint32_t hash;
tdb1_off_t rec_ptr;
struct tdb1_record rec;
+ union tdb_attribute hsize;
- plan_tests(24);
- tdb = tdb1_open("run-36-file.tdb", 1024, TDB_DEFAULT,
- O_CREAT|O_TRUNC|O_RDWR, 0600, &tap_log_attr);
+ hsize.base.attr = TDB_ATTRIBUTE_TDB1_HASHSIZE;
+ hsize.base.next = &tap_log_attr;
+ hsize.tdb1_hashsize.hsize = 1024;
+
+ plan_tests(26);
+ tdb = tdb_open("run-36-file.tdb1", TDB_VERSION1,
+ O_CREAT|O_TRUNC|O_RDWR, 0600, &hsize);
ok1(tdb);
tdb->tdb1.io = &large_io_methods;
orig_data.dsize = strlen("world");
orig_data.dptr = (void *)"world";
- ok1(tdb1_store(tdb, key, orig_data, TDB_INSERT) == 0);
+ ok1(tdb_store(tdb, key, orig_data, TDB_INSERT) == TDB_SUCCESS);
- data = tdb1_fetch(tdb, key);
+ ok1(tdb_fetch(tdb, key, &data) == TDB_SUCCESS);
ok1(data.dsize == strlen("world"));
ok1(memcmp(data.dptr, "world", strlen("world")) == 0);
free(data.dptr);
/* Transactions should work. */
ok1(tdb1_transaction_start(tdb) == 0);
- ok1(tdb1_store(tdb, key, orig_data, TDB_INSERT) == 0);
+ ok1(tdb_store(tdb, key, orig_data, TDB_INSERT) == TDB_SUCCESS);
- data = tdb1_fetch(tdb, key);
+ ok1(tdb_fetch(tdb, key, &data) == TDB_SUCCESS);
ok1(data.dsize == strlen("world"));
ok1(memcmp(data.dptr, "world", strlen("world")) == 0);
free(data.dptr);
ok1(tdb1_transaction_commit(tdb) == 0);
ok1(tdb1_traverse(tdb, test_traverse, &orig_data) == 1);
- tdb1_close(tdb);
+ tdb_close(tdb);
return exit_status();
}