added generic userDefinedTest function