test cases for customized cost functions