Skip to content

Commit

Permalink
fix test with multithreads environment
Browse files Browse the repository at this point in the history
fixes #182
  • Loading branch information
johnnychen94 committed Sep 23, 2020
1 parent 3609921 commit 472b362
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions test/2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,9 @@ end

err = ArgumentError("$(typestring(Fill{Int,1}))(0, (3,), (3,)) lacks the proper padding sizes for an array with 2 dimensions")
kern = Kernel.gaussian((1,1),(3,3))
@test_throws err imfilter(A, kern, Fill(0, (3,)))
@test_throws err imfilter(CPU1(), A, kern, Fill(0, (3,)))
kernf = ImageFiltering.factorkernel(kern)
err = DimensionMismatch("requested indices (1:8, 0:9) and kernel indices $(axes(kernf[1])) do not agree with indices of padded input, (0:9, 1:8)")
@test_throws err imfilter(A, kern, Fill(0, (1,0)))
@test_throws DimensionMismatch imfilter(A, kern, Fill(0, (0,1)))
@test_throws DimensionMismatch imfilter(A, kern, Fill(0, (0,0)))
@test_throws err imfilter(CPU1(), A, kern, Fill(0, (1,0)))
@test_throws DimensionMismatch imfilter(CPU1(), A, kern, Fill(0, (0,1)))
@test_throws DimensionMismatch imfilter(CPU1(), A, kern, Fill(0, (0,0)))
end
2 changes: 1 addition & 1 deletion test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using AxisArrays: AxisArray, Axis

tiles = ImageFiltering.tile_allocate(Float32, (rand(3),rand(3)'))
@test isa(tiles, Vector{Matrix{Float32}})
@test length(tiles) == 1
@test length(tiles) == Threads.nthreads()

@test length(ImageFiltering.safetail(CartesianIndices(()))) == 1
@test ImageFiltering.safetail(CartesianIndex(())) == CartesianIndex(())
Expand Down

0 comments on commit 472b362

Please sign in to comment.