Skip to content

Commit ee19d77

Browse files
change to alloccheck.jl
1 parent e6ce7aa commit ee19d77

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ julia = "1.10"
147147

148148
[extras]
149149
AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
150+
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
150151
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
151152
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
152153
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
@@ -171,4 +172,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
171172
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
172173

173174
[targets]
174-
test = ["Calculus", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve"]
175+
test = ["Calculus", "AllocCheck", "ComponentArrays", "Symbolics", "AlgebraicMultigrid", "IncompleteLU", "DiffEqCallbacks", "DiffEqDevTools", "ODEProblemLibrary", "ElasticArrays", "InteractiveUtils", "ParameterizedFunctions", "PoissonRandom", "Printf", "Random", "ReverseDiff", "SafeTestsets", "SparseArrays", "Statistics", "Test", "Unitful", "ModelingToolkit", "Pkg", "NLsolve"]

test/integrators/callback_allocation_tests.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using OrdinaryDiffEq, Test
2-
using OrdinaryDiffEqCore
2+
using OrdinaryDiffEqCore, AllocCheck
33

44
# Setup a simple ODE problem with several callbacks (to test LLVM code gen)
55
# We will manually trigger the first callback and check its allocations.
@@ -39,11 +39,9 @@ integrator = init(
3939
# call handle callbacks
4040
step!(integrator, 0.1, true)
4141

42-
if VERSION >= v"1.7"
43-
function handle_allocs(integrator)
44-
integrator.u[1] = 0.4
45-
@allocations OrdinaryDiffEqCore.handle_callbacks!(integrator)
46-
end
47-
handle_allocs(integrator)
48-
@test handle_allocs(integrator) == 0
49-
end
42+
function handle_allocs(integrator)
43+
integrator.u[1] = 0.4
44+
OrdinaryDiffEqCore.handle_callbacks!(integrator)
45+
end
46+
handle_allocs(integrator)
47+
@check_allocs handle_allocs(integrator)

0 commit comments

Comments
 (0)