Skip to content

Commit 195fe78

Browse files
Merge pull request #2208 from oscardssmith/os/relax-check-error
relax check_error tests
2 parents 46e3153 + 40562ee commit 195fe78

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/integrators/check_error.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ u0 = 0.0 # explosion time is 1.0
55
tspan = (0.0, 10.0)
66
prob = ODEProblem(f_ec, u0, tspan)
77
options = [:reltol => 1e-8, :abstol => 1e-8, :verbose => false]
8-
desired_code = ReturnCode.MaxIters
8+
desired_codes = (ReturnCode.MaxIters, ReturnCode.Unstable)
99

1010
# Test that sol.retcode is set to the correct value by various ways to
1111
# invoke integrator.
1212

1313
sol = solve(prob, Tsit5(); options...)
14-
@test sol.retcode == desired_code
14+
@test sol.retcode in desired_codes
1515

1616
integrator = init(prob, Tsit5(); options...)
1717
solve!(integrator)
18-
@test integrator.sol.retcode == desired_code
18+
@test integrator.sol.retcode in desired_codes
1919

2020
integrator = init(prob, Tsit5(); options...)
2121
for _ in integrator
2222
end
23-
@test integrator.sol.retcode == desired_code
23+
@test integrator.sol.retcode in desired_codes
2424

2525
integrator = init(prob, Tsit5(); options...)
2626
step!(integrator, 10.0)
27-
@test integrator.sol.retcode == desired_code
27+
@test integrator.sol.retcode in desired_codes
2828

2929
# Test check_error
3030
integrator = init(prob, Tsit5(); options...)
@@ -33,7 +33,7 @@ step!(integrator)
3333
ok = false
3434
for i in 1:(integrator.opts.maxiters)
3535
step!(integrator)
36-
if check_error(integrator) == desired_code
36+
if check_error(integrator) in desired_codes
3737
global ok = true
3838
# @show i
3939
break

0 commit comments

Comments
 (0)