Test for iterative function with failure case.