finished unit test for db.c