Skip to content

Commit

Permalink
add test for non-Arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
gummif committed Nov 7, 2014
1 parent 5d4f81e commit 90c8eba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 1 addition & 8 deletions src/wavelettypes.jl
Expand Up @@ -93,14 +93,7 @@ function GLS{T<:WaveletBoundary}(name::String, ::Type{T}=DEF_BOUNDARY)
schemedef == nothing && error("scheme not found")
return GLS{T}(schemedef..., name)
end
convertstep(T::Type, step::LSstep) = LSstep(step.stept, convert(Vector{T}, step.coef), step.shift)
function convertsteps(T::Type, steps::Vector{LSstep})
out = Array(LSstep, length(steps))
for i = 1:length(steps)
out[i] = convertstep(T, steps[i])
end
return out
end


# IMPLEMENTATIONS OF ContinuousWavelet

Expand Down
6 changes: 6 additions & 0 deletions test/transforms.jl
Expand Up @@ -152,6 +152,12 @@ ft = Int32; x, y = makedwt(ft, sett...)
@test Array{typeof(float(x[1])),2} == typeof(y) && length(y) == n*n
@test_approx_eq dwt(x,wf) dwt(float(x),wf)

# non-Array type
wt = GLS("db2")
x = randn(16, 16)
xs = sub(x, 1:16, 1:16)
@test_approx_eq dwt(x,wt,2) dwt(xs,wt,2)


# ============= error tests ================

Expand Down

0 comments on commit 90c8eba

Please sign in to comment.