Added test method testErrorAndResult.