Skip to content

Commit

Permalink
test consistency.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
wookay committed Sep 15, 2018
1 parent 829f1e1 commit 6370eca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -11,7 +11,7 @@ notifications:
email: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia --check-bounds=yes -e 'using Pkg; Pkg.init(); Pkg.clone(pwd()); Pkg.build("WORLD"); Pkg.test("WORLD", coverage=true)'
- julia --check-bounds=yes -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("WORLD"); Pkg.test("WORLD", coverage=true)'
after_success:
- julia -e 'using Pkg; cd(Pkg.dir("WORLD")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- julia -e 'using Pkg; Pkg.add("Documenter");'
Expand Down
8 changes: 4 additions & 4 deletions test/consistency.jl
Expand Up @@ -6,11 +6,11 @@
# WORLD.

using WORLD
using Base.Test
using Test, DelimitedFiles

@assert WORLD.version >= v"0.3.0"

info("Check consistency with the original WORLD")
@info("Check consistency with the original WORLD")

x = vec(readdlm(joinpath(dirname(@__FILE__), "data", "x.txt")))

Expand All @@ -32,13 +32,13 @@ spectrogram_org = readdlm(joinpath(dirname(@__FILE__), "data", "spectrogram.txt"

println("Maximum error in CheapTrick is $(maximum(abs.(spectrogram - spectrogram_org)))")
@test size(spectrogram) == size(spectrogram_org)
@test isapprox(spectrogram, spectrogram_org, atol=1.0e-10)
@test isapprox(spectrogram, spectrogram_org, atol=1.0e-9)

aperiodicity = d4c(x, fs, timeaxis, f0; opt=D4COption())
aperiodicity_org = readdlm(joinpath(dirname(@__FILE__), "data", "aperiodicity.txt"))'
println("Maximum error in D4C is $(maximum(abs.(aperiodicity-aperiodicity_org)))")
@test size(aperiodicity) == size(aperiodicity)
@test isapprox(aperiodicity, aperiodicity_org, atol=1.0e-10)
@test isapprox(aperiodicity, aperiodicity_org, atol=1.0e-6)

# Synthesis
y_length = trunc(Int, ((length(f0)-1)*period/1000 * fs) + 1)
Expand Down

0 comments on commit 6370eca

Please sign in to comment.