Skip to content

Commit dc867d5

Browse files
authored
Fix OutOfMemoryError in test (#154)
Create reasonably sized arrays if the test does not require specific sizes. This fixes `OutOfMemoryError`s in local tests on machines with limited RAM
1 parent 8c07770 commit dc867d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/runtests.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ end
196196
@test axes(y) == (IdentityUnitRange(-1:1),)
197197
@test eltype(y) === Float32
198198

199-
y = OffsetArray{Float64}(undef, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1)
200-
@test axes(y) == (-1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1)
199+
y = OffsetArray{Float64}(undef, -1:1, -7:7, -1:2, -5:5, -1:1, -3:3, -2:2, -1:1)
200+
@test axes(y) == (-1:1, -7:7, -1:2, -5:5, -1:1, -3:3, -2:2, -1:1)
201201
@test eltype(y) === Float64
202202

203203
for (T, t) in ((Missing, missing), (Nothing, nothing))
@@ -303,10 +303,10 @@ end
303303
@inbounds Ac[0,3,1] = 12
304304
@test Ac[0,3] == 12
305305

306-
y = OffsetArray{Float64}(undef, -1:1, -7:7, -128:512, -5:5, -1:1, -3:3, -2:2, -1:1)
307-
y[-1,-7,-128,-5,-1,-3,-2,-1] = 14
308-
y[-1,-7,-128,-5,-1,-3,-2,-1] += 5
309-
@test y[-1,-7,-128,-5,-1,-3,-2,-1] == 19
306+
y = OffsetArray{Float64}(undef, -1:1, -7:7, -3:-1, -5:5, -1:1, -3:3, -2:2, -1:1)
307+
y[-1,-7,-3,-5,-1,-3,-2,-1] = 14
308+
y[-1,-7,-3,-5,-1,-3,-2,-1] += 5
309+
@test y[-1,-7,-3,-5,-1,-3,-2,-1] == 19
310310

311311
@testset "setindex!" begin
312312
A = OffsetArray(ones(2,2), 1:2, 1:2)

0 commit comments

Comments
 (0)