Skip to content

Commit

Permalink
add a few more coverage lines
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-petersen committed Mar 3, 2024
1 parent eae543c commit 6ca3a57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/Legendre/Legendre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,26 @@ function GettabD!(omg::ComplexF64,

# check the imaginary sign. if negative, use damped integration
if (imag(omg) < 0.0)
if verbose > 2
println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using DAMPED Legendre integration.")
end
#if verbose > 2
# println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using DAMPED Legendre integration.")
#end

tabLeg!_DAMPED(omg,struct_tabLeg)

# if exactly zero, use neutral mode calculation
elseif (imag(omg) == 0.0)
if verbose > 2
println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using NEUTRAL Legendre integration.")
end
#if verbose > 2
# println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using NEUTRAL Legendre integration.")
#end

tabLeg!_NEUTRAL(omg,struct_tabLeg)

# by default, use unstable integration
else

if verbose > 2
println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using UNSTABLE Legendre integration.")
end
#if verbose > 2
# println("FiniteHilbertTransform.Legendre.get_tabLeg!: Using UNSTABLE Legendre integration.")
#end

tabLeg!_UNSTABLE(omg,struct_tabLeg)
end
Expand Down
14 changes: 13 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test imag(FHT.tabPLeg[1]) == 0.0
end

@testset "Legendre Damped Frequency: Heaviside checks" begin
@testset "Legendre Damped Frequency: Recurrence and Heaviside checks" begin
ϖ = 0.99 - 0.5im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) -1.411690420739939 atol=tol
ϖ = 0.99 - 0.02im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) -4.48863636973214 atol=tol
Expand All @@ -76,6 +79,15 @@ end
ϖ = 1.01 - 0.02im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) -4.498635453116724 atol=tol
ϖ = 1.0 - 0.00im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) == 0.0 # verify this?
ϖ = 1.01 - 0.00im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) -5.303304908059075 atol=tol
ϖ = -1.0 - 0.02im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) 4.605220183488258 atol=tol
ϖ = -1.01 - 0.02im
FiniteHilbertTransform.GettabD!(ϖ,FHT)
@test real(FHT.tabDLeg[1]) 4.498635453116724 atol=tol
Expand Down

0 comments on commit 6ca3a57

Please sign in to comment.