Skip to content

Commit

Permalink
Update callback_allocation_tests.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Sep 14, 2023
1 parent 4fb7298 commit dd2d125
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions test/integrators/callback_allocation_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ integrator = init(ODEProblem(f!, [0.8, 1.0], (0.0, 100.0), [0, 0]), Tsit5(), cal
# call handle callbacks
step!(integrator, 0.1, true)

function handle_allocs(integrator)
integrator.u[1] = 0.4
@allocations OrdinaryDiffEq.handle_callbacks!(integrator)
if VERSION >= v"1.7"
function handle_allocs(integrator)
integrator.u[1] = 0.4
@allocations OrdinaryDiffEq.handle_callbacks!(integrator)
end
handle_allocs(integrator);
@test handle_allocs(integrator) == 0
end
handle_allocs(integrator);
@test handle_allocs(integrator) == 0

0 comments on commit dd2d125

Please sign in to comment.