Skip to content

Commit 5dff1ba

Browse files
committed
allocations needs v1.9
1 parent cde9b6f commit 5dff1ba

File tree

1 file changed

+19
-16
lines changed

1 file changed

+19
-16
lines changed

test/runtests.jl

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -355,20 +355,23 @@ end
355355
@test deserialized == data
356356
end
357357

358-
@vars x y
359-
a = Basic()
360-
@testset "non-allocating(ish) methods" begin
361-
sin(x), cos(x), abs(x)
362-
x^x, x + x, x*x, x-x, x/x # warm up
363-
364-
@test (@allocations SymEngine.sin!(a,x)) == 0
365-
@test (@allocations SymEngine.cos!(a,x)) == 0
366-
@test (@allocations SymEngine.pow!(a,x,x)) == 0
367-
368-
# still allocates 1 (or 2)
369-
@test (@allocations SymEngine.add!(a,x,y)) < (@allocations x+y)
370-
@test (@allocations SymEngine.sub!(a,x,y)) < (@allocations x-y)
371-
@test (@allocations SymEngine.mul!(a,x,y)) < (@allocations x*y)
372-
@test (@allocations SymEngine.div!(a,x,y)) < (@allocations x/y)
373-
@test (@allocations SymEngine.abs2!(a,x)) < (@allocations abs2(x))
358+
if VERSION >= v"1.9.0"
359+
360+
@vars x y
361+
a = Basic()
362+
@testset "non-allocating(ish) methods" begin
363+
sin(x), cos(x), abs(x)
364+
x^x, x + x, x*x, x-x, x/x # warm up
365+
366+
@test (@allocations SymEngine.sin!(a,x)) == 0
367+
@test (@allocations SymEngine.cos!(a,x)) == 0
368+
@test (@allocations SymEngine.pow!(a,x,x)) == 0
369+
370+
# still allocates 1 (or 2)
371+
@test (@allocations SymEngine.add!(a,x,y)) < (@allocations x+y)
372+
@test (@allocations SymEngine.sub!(a,x,y)) < (@allocations x-y)
373+
@test (@allocations SymEngine.mul!(a,x,y)) < (@allocations x*y)
374+
@test (@allocations SymEngine.div!(a,x,y)) < (@allocations x/y)
375+
@test (@allocations SymEngine.abs2!(a,x)) < (@allocations abs2(x))
376+
end
374377
end

0 commit comments

Comments
 (0)