base code for the test functions