}
mem = malloc(off);
+ /* Fill with some weird pattern. */
+ memset(mem, 0x99, off);
/* Now populate our header, cribbing from a real TDB header. */
tdb = tdb_open(NULL, TDB_INTERNAL, O_RDWR, 0, &tap_log_attr);
memcpy(mem, tdb->map_ptr, sizeof(struct tdb_header));
key.dsize = 5;
/* No coalescing can be done due to EOF */
- layout = new_tdb_layout(NULL);
+ layout = new_tdb_layout("run-03-coalesce.tdb");
tdb_layout_add_freetable(layout);
len = 1024;
tdb_layout_add_free(layout, len, 0);
tdb_layout_free(layout);
/* No coalescing can be done due to used record */
- layout = new_tdb_layout(NULL);
+ layout = new_tdb_layout("run-03-coalesce.tdb");
tdb_layout_add_freetable(layout);
tdb_layout_add_free(layout, 1024, 0);
tdb_layout_add_used(layout, key, data, 6);
tdb_layout_free(layout);
/* Coalescing can be done due to two free records, then EOF */
- layout = new_tdb_layout(NULL);
+ layout = new_tdb_layout("run-03-coalesce.tdb");
tdb_layout_add_freetable(layout);
tdb_layout_add_free(layout, 1024, 0);
tdb_layout_add_free(layout, 2048, 0);
tdb_layout_free(layout);
/* Coalescing can be done due to two free records, then data */
- layout = new_tdb_layout(NULL);
+ layout = new_tdb_layout("run-03-coalesce.tdb");
tdb_layout_add_freetable(layout);
tdb_layout_add_free(layout, 1024, 0);
tdb_layout_add_free(layout, 512, 0);
tdb_layout_free(layout);
/* Coalescing can be done due to three free records, then EOF */
- layout = new_tdb_layout(NULL);
+ layout = new_tdb_layout("run-03-coalesce.tdb");
tdb_layout_add_freetable(layout);
tdb_layout_add_free(layout, 1024, 0);
tdb_layout_add_free(layout, 512, 0);