Skip to content

Commit 9636624

Browse files
committed
pass rhs! instead of mod
1 parent 03404c4 commit 9636624

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/macros.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,17 @@ macro trixi_testset(name, expr)
194194
end
195195

196196
"""
197-
@test_allocations(mod, semi, sol, allocs)
197+
@test_allocations(rhs!, semi, sol, allocs)
198198
199-
Test that the memory allocations of `mod.rhs!` are below `allocs`
200-
(e.g., from type instabilities), where `mod` is a module containing
199+
Test that the memory allocations of `rhs!` are below `allocs`
200+
(e.g., from type instabilities), where `rhs!` is a function with
201201
a method `rhs!(du, u, semi, t)`.
202202
"""
203-
macro test_allocations(mod, semi, sol, allocs)
203+
macro test_allocations(rhs!, semi, sol, allocs)
204204
quote
205205
t = $(esc(sol)).t[end]
206206
u = $(esc(sol)).u[end]
207207
du = similar(u)
208-
@test (@allocated $(esc(mod)).rhs!(du, u, $(esc(semi)), t)) < $(esc(allocs))
208+
@test (@allocated $(esc(rhs!))(du, u, $(esc(semi)), t)) < $(esc(allocs))
209209
end
210210
end

test/test_test_allocations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ end
1010
semi = nothing
1111
sol = (t = [1.0], u = [[1.0, 2.0]])
1212
allocs = 1
13-
@test_allocations(TestAllocations, semi, sol, allocs)
13+
@test_allocations(TestAllocations.rhs!, semi, sol, allocs)
1414
end

0 commit comments

Comments
 (0)