Skip to content

Commit 7a0d834

Browse files
committed
add test
1 parent 39c58fb commit 7a0d834

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

test/issues/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ using Interpolations, Test, ForwardDiff
156156
end
157157
@testset "issue 469" begin
158158
# We have different inference result on different version.
159-
max_dim = VERSION < v"1.3" ? 3 : isdefined(Base, :Any32) ? 7 : 5
159+
max_dim = isdefined(Base, :Any32) ? 7 : 5
160160
for dims in 3:max_dim
161161
A = zeros(Float64, ntuple(_ -> 5, dims))
162162
itp = interpolate(A, BSpline(Quadratic(Reflect(OnCell()))))

test/nointerp.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@
1414
# @test ae[0,1] === NaN
1515
# @test_throws InexactError ae(1.5,2)
1616
end
17+
18+
@testset "Stability of mixtrue with NoInterp and Interp" begin
19+
A = zeros(Float64, 5, 5, 5, 5, 5, 5, 5)
20+
st = BSpline(Quadratic(Reflect(OnCell()))), NoInterp(),
21+
BSpline(Linear()), NoInterp(),
22+
BSpline(Quadratic()), NoInterp(),
23+
BSpline(Quadratic(Reflect(OnCell())))
24+
itp = interpolate(A, st)
25+
@test (@inferred Interpolations.hessian(itp, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)) == zeros(4,4)
26+
@test (@inferred Interpolations.gradient(itp, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)) == zeros(4)
27+
@test (@inferred itp(1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)) == 0
28+
end

0 commit comments

Comments
 (0)