Skip to content

Commit 8854baa

Browse files
Update test/interface_tests.jl
1 parent 4d8130e commit 8854baa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/interface_tests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,16 @@ z .= x .+ y
126126

127127
@test z == VectorOfArray([fill(4, SVector{2, Float64}), fill(2, SVector{2, Float64})])
128128

129+
u1 = VectorOfArray([fill(2, SVector{2, Float64}), ones(SVector{2, Float64})])
130+
u2 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})])
131+
u3 = VectorOfArray([fill(4, SVector{2, Float64}), 2 .* ones(SVector{2, Float64})])
132+
133+
function f(u1,u2,u3)
134+
u3 .= u1 .+ u2
135+
end
136+
f(u1,u2,u3)
137+
@test@allocated f(u1,u2,u3) == 0
138+
129139
yy = [2.0 1.0; 2.0 1.0]
130140
zz = x .+ yy
131141
@test zz == [4.0 2.0; 4.0 2.0]

0 commit comments

Comments
 (0)