Skip to content

Commit

Permalink
fix errors and warnings on Julia 0.7 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 authored Nov 27, 2017
1 parent a0ca6a1 commit 7bbef28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 7bbef28

Please sign in to comment.