Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix errors and warnings on Julia 0.7 #10

Merged
merged 1 commit into from
Nov 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/decompression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function GzipDecompressor(;windowbits::Integer=Z_DEFAULT_WINDOWBITS, gziponly::B
if !(8 ≤ windowbits ≤ 15)
throw(ArgumentError("windowbits must be within 8..15"))
end
return GzipDecompressor(ZStream(), windowbits+(gziponly?16:32))
return GzipDecompressor(ZStream(), windowbits+(gziponly ? 16 : 32))
end

const GzipDecompressorStream{S} = TranscodingStream{GzipDecompressor,S} where S<:IO
Expand Down
2 changes: 1 addition & 1 deletion src/libz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Z_DEFAULT_STRATEGY = Cint(0)
const Z_DEFAULT_MEMLEVEL = Cint(8)
const Z_DEFAULT_WINDOWBITS = Cint(15)

if is_windows()
if isdefined(Sys, :iswindows) ? Sys.iswindows() : is_windows()
const libz = "zlib1"
else
const libz = "libz"
Expand Down
12 changes: 6 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const testdir = @__DIR__
@testset "Gzip Codec" begin
codec = GzipCompressor()
@test codec isa GzipCompressor
@test ismatch(r"^CodecZlib.GzipCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?GzipCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

codec = GzipDecompressor()
@test codec isa GzipDecompressor
@test ismatch(r"^CodecZlib.GzipDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?GzipDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down Expand Up @@ -118,13 +118,13 @@ end
@testset "Zlib Codec" begin
codec = ZlibCompressor()
@test codec isa ZlibCompressor
@test ismatch(r"^CodecZlib\.ZlibCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?ZlibCompressor\(level=-1, windowbits=\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

codec = ZlibDecompressor()
@test codec isa ZlibDecompressor
@test ismatch(r"^CodecZlib\.ZlibDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?ZlibDecompressor\(windowbits=\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down Expand Up @@ -198,14 +198,14 @@ end
@testset "Deflate Codec" begin
codec = DeflateCompressor()
@test codec isa DeflateCompressor
@test ismatch(r"^CodecZlib\.DeflateCompressor\(level=-1, windowbits=-\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?DeflateCompressor\(level=-1, windowbits=-\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
# FIXME: This test fails.
#@test CodecZlib.finalize(codec) === nothing

codec = DeflateDecompressor()
@test codec isa DeflateDecompressor
@test ismatch(r"^CodecZlib\.DeflateDecompressor\(windowbits=-\d+\)$", sprint(show, codec))
@test ismatch(r"^(CodecZlib\.)?DeflateDecompressor\(windowbits=-\d+\)$", sprint(show, codec))
@test CodecZlib.initialize(codec) === nothing
@test CodecZlib.finalize(codec) === nothing

Expand Down