tests for database functions