Skip to content

Commit

Permalink
add test for successful return code
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsas committed Feb 17, 2023
1 parent 2d1beff commit acecc4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SSA_stepper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ function DiffEqBase.solve!(integrator::SSAIntegrator)
end

DiffEqBase.finalize!(integrator.opts.callback, integrator.u, integrator.t, integrator)

if integrator.sol.retcode === ReturnCode.Default
integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, ReturnCode.Success)
integrator.sol = DiffEqBase.solution_new_retcode(integrator.sol, ReturnCode.Success)
end
end

Expand Down
3 changes: 2 additions & 1 deletion test/ssa_tests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using JumpProcesses, DiffEqBase
using JumpProcesses, DiffEqBase, SciMLBase
using Test
using StableRNGs
rng = StableRNG(12345)
Expand All @@ -25,6 +25,7 @@ integrator.u[1]
# test different saving behaviors

sol = solve(jump_prob, SSAStepper())
@test SciMLBase.successful_retcode(sol)
@test sol.t[begin] == 0.0
@test sol.t[end] == 3.0

Expand Down

0 comments on commit acecc4a

Please sign in to comment.