diff --git a/test/common_interface/iterators.jl b/test/common_interface/iterators.jl index cb2ff22..b2b1a12 100644 --- a/test/common_interface/iterators.jl +++ b/test/common_interface/iterators.jl @@ -25,11 +25,11 @@ u2 = copy(integrator.u) @test u1 != vec(prob.u0) @test u1 == u2 -f(u, p, t) = [2 * u[1]] +f_terminate(u, p, t) = [2 * u[1]] u_positive(u, t, integrator) = u[1] > 0 terminate_if_u_pos = DiscreteCallback(u_positive, terminate!) -prob = ODEProblem(f, [1.0], (0.0, 1.0)) # positive initial condition > positive u > :Terminated +prob = ODEProblem(f_terminate, [1.0], (0.0, 1.0)) # positive initial condition > positive u > :Terminated integrator = init(prob, CVODE_BDF(), callback=terminate_if_u_pos) sol1 = solve!(integrator) @test sol1.retcode === :Terminated @@ -38,7 +38,7 @@ reinit!(integrator, [-1.0]) # negative initial condition > negative u > :Success sol2 = solve!(integrator) @test sol2.retcode == :Success -prob = ODEProblem(f, [-1.0], (0.0, 1.0)) # negative initial condition > negative u > :Success! +prob = ODEProblem(f_terminate, [-1.0], (0.0, 1.0)) # negative initial condition > negative u > :Success! integrator = init(prob, CVODE_BDF(), callback=terminate_if_u_pos) sol3 = solve!(integrator) @test sol3.retcode == :Success \ No newline at end of file