begin test scripts , fix type in db.c