Passing test function as argument