X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb%2Ftest%2Frun-corrupt.c;h=a5c4aa4417e8d5f7b0565a3c6ec5781df6630b68;hb=95458bafc9dc99ac8fcd68aa8f48a9fc564e6a31;hp=3bf78835527992f6e16b557b5da947fe06f4bcb6;hpb=39357f4e89f4ac02eb11861812cbfc67b4f1d4ef;p=ccan diff --git a/ccan/tdb/test/run-corrupt.c b/ccan/tdb/test/run-corrupt.c index 3bf78835..a5c4aa44 100644 --- a/ccan/tdb/test/run-corrupt.c +++ b/ccan/tdb/test/run-corrupt.c @@ -76,9 +76,9 @@ static void check_test(struct tdb_context *tdb) /* From the free list chain and hash chains. */ verifiable += 3 * sizeof(tdb_off_t); /* From the record headers & tailer */ - verifiable += 5 * (sizeof(struct list_struct) + sizeof(uint32_t)); + verifiable += 5 * (sizeof(struct tdb_record) + sizeof(uint32_t)); /* The free block: we ignore datalen, keylen, full_hash. */ - verifiable += sizeof(struct list_struct) - 3*sizeof(uint32_t) + + verifiable += sizeof(struct tdb_record) - 3*sizeof(uint32_t) + sizeof(uint32_t); /* Our check function verifies the key and data. */ verifiable += ksize + dsize; @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) plan_tests(4); /* This should use mmap. */ - tdb = tdb_open("/tmp/test6.tdb", 2, TDB_CLEAR_IF_FIRST, + tdb = tdb_open("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST, O_CREAT|O_TRUNC|O_RDWR, 0600); if (!tdb) @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) tdb_close(tdb); /* This should not. */ - tdb = tdb_open("/tmp/test6.tdb", 2, TDB_CLEAR_IF_FIRST|TDB_NOMMAP, + tdb = tdb_open("run-corrupt.tdb", 2, TDB_CLEAR_IF_FIRST|TDB_NOMMAP, O_CREAT|O_TRUNC|O_RDWR, 0600); if (!tdb)