From 4f6f3732b09924d27d10f8de365caeaa7492ed89 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Sun, 12 Jun 2016 13:42:42 +0000 Subject: [PATCH] * fix tests --- tests/bitmap.c | 2 +- tests/database.c | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/bitmap.c b/tests/bitmap.c index 5c2feb9..9000744 100644 --- a/tests/bitmap.c +++ b/tests/bitmap.c @@ -2,7 +2,7 @@ #include "../src/bitmap.h" int -main(int argc, char **argv) +main() { bitmap_t a, b; diff --git a/tests/database.c b/tests/database.c index 7673412..cac21f1 100644 --- a/tests/database.c +++ b/tests/database.c @@ -1,34 +1,33 @@ #include "../src/common.h" #include "../src/database.h" -int main(int argc, char **argv) +int main() { - imdb_t db; + imdb_db_t db; imdb_rec_t rec[2]; - block_t blk; + imdb_block_t blk; char *path = "test.db"; unlink(path); - assert(imdb_open(&db, path) == 1); + assert(imdb_open(&db, path, 1) == 1); rec[0].num = 1; - assert(db_rd_rec(&db, rec) == 0); + assert(imdb_read_rec(&db, rec) == 0); memset(rec[0].data, 0xAA, IMDB_REC_LEN); - assert(db_wr_rec(&db, rec) == 1); + assert(imdb_write_rec(&db, rec) == 1); - assert(db_rd_rec(&db, rec) == 1); + assert(imdb_read_rec(&db, rec) == 1); blk.start = 1; blk.records = 2; blk.data = NULL; - assert(db_rd_blk(&db, &blk) == 1); + assert(imdb_read_blk(&db, &blk) == 1); assert(blk.records == 1); assert(blk.data != NULL); rec[0].num = 1; rec[1].num = 3; - assert(db_rd_list(&db, rec, 2) == 1); assert(imdb_close(&db) == 0);