Skip to content

Commit 7b3efbe

Browse files
committed
test allocations
1 parent 015ab07 commit 7b3efbe

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/test_diag.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,15 @@ end
5252
@test abs(B.d - Bref) <= 1e-10
5353
end
5454
end
55+
56+
@testset "Allocations test" begin
57+
d = rand(5)
58+
A = DiagonalQN(d)
59+
v = rand(5)
60+
u = similar(v)
61+
mul!(u, A, v)
62+
@test (@allocated mul!(u, A, v)) == 0
63+
B = SpectralGradient(rand(), 5)
64+
mul!(u, B, v)
65+
@test (@allocated mul!(u, B, v)) == 0
66+
end

0 commit comments

Comments
 (0)