Skip to content
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 ChunkCodecCore/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ authors = ["nhz2 <[email protected]>"]
version = "0.4.0"

[compat]
julia = "1.11"
julia = "1.10"
51 changes: 28 additions & 23 deletions ChunkCodecCore/src/ChunkCodecCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,46 @@ module ChunkCodecCore

export decode, encode

public Codec
public EncodeOptions
public DecodeOptions
if VERSION >= v"1.11.0-DEV.469"
eval(Meta.parse("""
public
Codec,
EncodeOptions,
DecodeOptions,

public DecodingError
public DecodedSizeError
DecodingError,
DecodedSizeError,

public decode_options
decode_options,

public decoded_size_range
public encode_bound
public try_encode!
decoded_size_range,
encode_bound,
try_encode!,

public try_find_decoded_size
public try_decode!
try_find_decoded_size,
try_decode!,

public check_in_range
public check_contiguous
check_in_range,
check_contiguous,

public can_concatenate
public is_thread_safe
public try_resize_decode!
can_concatenate,
is_thread_safe,
try_resize_decode!,

public NoopCodec
public NoopEncodeOptions
public NoopDecodeOptions
NoopCodec,
NoopEncodeOptions,
NoopDecodeOptions,

public ShuffleCodec
public ShuffleEncodeOptions
public ShuffleDecodeOptions
ShuffleCodec,
ShuffleEncodeOptions,
ShuffleDecodeOptions
"""))
end

include("types.jl")
include("errors.jl")
include("interface.jl")
include("noop.jl")
include("shuffle.jl")

end
end
44 changes: 42 additions & 2 deletions ChunkCodecCore/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ end
@testset "check helpers" begin
@test_throws Exception ChunkCodecCore.check_contiguous(@view(zeros(UInt8, 8)[1:2:end]))
@test_throws Exception ChunkCodecCore.check_contiguous(0x00:0xFF)
@test isnothing(ChunkCodecCore.check_contiguous(Memory{UInt8}(undef, 3)))
if VERSION ≥ v"1.11"
@test isnothing(ChunkCodecCore.check_contiguous(Memory{UInt8}(undef, 3)))
end
@test isnothing(ChunkCodecCore.check_contiguous(Vector{UInt8}(undef, 3)))
@test isnothing(ChunkCodecCore.check_contiguous(@view(zeros(UInt8, 8)[1:1:end])))
@test_throws ArgumentError ChunkCodecCore.check_in_range(1:6; x=0)
Expand Down Expand Up @@ -87,4 +89,42 @@ end
# negative max_size
@test_throws DecodedSizeError(Int64(-1), nothing) decode(d, ones(UInt8, Int64(100)); max_size=Int64(-1))
@test_throws DecodedSizeError(typemin(Int64), nothing) decode(d, ones(UInt8, Int64(100)); max_size=typemin(Int128))
end
end
@testset "public" begin
if VERSION >= v"1.11.0-DEV.469"
for sym in (
:Codec,
:EncodeOptions,
:DecodeOptions,

:DecodingError,
:DecodedSizeError,

:decode_options,

:decoded_size_range,
:encode_bound,
:try_encode!,

:try_find_decoded_size,
:try_decode!,

:check_in_range,
:check_contiguous,

:can_concatenate,
:is_thread_safe,
:try_resize_decode!,

:NoopCodec,
:NoopEncodeOptions,
:NoopDecodeOptions,

:ShuffleCodec,
:ShuffleEncodeOptions,
:ShuffleDecodeOptions
)
@test Base.ispublic(ChunkCodecCore, sym)
end
end
end
2 changes: 1 addition & 1 deletion ChunkCodecTests/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[compat]
ChunkCodecCore = "0.4"
Test = "1"
julia = "1.11"
julia = "1.10"
2 changes: 1 addition & 1 deletion ChunkCodecs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ChunkCodecLibLz4 = "0.1"
ChunkCodecLibSnappy = "0.1"
ChunkCodecLibZlib = "0.1"
ChunkCodecLibZstd = "0.1"
julia = "1.11"
julia = "1.10"

[sources]
ChunkCodecCore = {path = "../ChunkCodecCore"}
Expand Down
2 changes: 1 addition & 1 deletion LibBlosc/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ ChunkCodecCore = "0b6fb165-00bc-4d37-ab8b-79f91016dbe1"
[compat]
Blosc_jll = "1"
ChunkCodecCore = "0.4"
julia = "1.11"
julia = "1.10"
4 changes: 3 additions & 1 deletion LibBlosc/src/ChunkCodecLibBlosc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ export BloscCodec,
BloscDecodeOptions,
BloscDecodingError

public is_compressor_valid, compcode, compname
if VERSION >= v"1.11.0-DEV.469"
eval(Meta.parse("public is_compressor_valid, compcode, compname"))
end

# reexport ChunkCodecCore
using ChunkCodecCore: ChunkCodecCore, encode, decode
Expand Down
7 changes: 7 additions & 0 deletions LibBlosc/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ end
c[end-5] = 0x40
@test_throws BloscDecodingError decode(BloscDecodeOptions(), c)
end
@testset "public" begin
if VERSION >= v"1.11.0-DEV.469"
for sym in (:is_compressor_valid, :compcode, :compname)
@test Base.ispublic(ChunkCodecLibBlosc, sym)
end
end
end
2 changes: 1 addition & 1 deletion LibBzip2/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ ChunkCodecCore = "0b6fb165-00bc-4d37-ab8b-79f91016dbe1"
[compat]
Bzip2_jll = "1"
ChunkCodecCore = "0.4"
julia = "1.11"
julia = "1.10"
2 changes: 1 addition & 1 deletion LibLz4/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Lz4_jll = "5ced341a-0733-55b8-9ab6-a4889d929147"
[compat]
ChunkCodecCore = "0.4"
Lz4_jll = "1"
julia = "1.11"
julia = "1.10"
2 changes: 1 addition & 1 deletion LibSnappy/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ snappy_jll = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd"
[compat]
ChunkCodecCore = "0.4"
snappy_jll = "1"
julia = "1.11"
julia = "1.10"
2 changes: 1 addition & 1 deletion LibZlib/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Zlib_jll = "83775a58-1f1d-513f-b197-d71354ab007a"
[compat]
ChunkCodecCore = "0.4"
Zlib_jll = "1"
julia = "1.11"
julia = "1.10"
2 changes: 1 addition & 1 deletion LibZstd/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Zstd_jll = "3161d3a3-bdf6-5164-811a-617609db77b4"
[compat]
ChunkCodecCore = "0.4"
Zstd_jll = "1.5.6"
julia = "1.11"
julia = "1.10"
22 changes: 14 additions & 8 deletions LibZstd/src/ChunkCodecLibZstd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ export ZstdCodec,
ZstdDecodeOptions,
ZstdDecodingError

public ZSTD_minCLevel,
ZSTD_maxCLevel,
ZSTD_defaultCLevel,
ZSTD_versionNumber,
ZSTD_isError,
ZSTD_bounds,
ZSTD_cParam_getBounds,
ZSTD_dParam_getBounds

if VERSION >= v"1.11.0-DEV.469"
eval(Meta.parse("""
public
ZSTD_minCLevel,
ZSTD_maxCLevel,
ZSTD_defaultCLevel,
ZSTD_versionNumber,
ZSTD_isError,
ZSTD_bounds,
ZSTD_cParam_getBounds,
ZSTD_dParam_getBounds
"""))
end

# reexport ChunkCodecCore
using ChunkCodecCore: ChunkCodecCore, encode, decode
Expand Down
16 changes: 16 additions & 0 deletions LibZstd/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,19 @@ end
"ZstdDecodingError: ",
)
end
@testset "public" begin
if VERSION >= v"1.11.0-DEV.469"
for sym in (
:ZSTD_minCLevel,
:ZSTD_maxCLevel,
:ZSTD_defaultCLevel,
:ZSTD_versionNumber,
:ZSTD_isError,
:ZSTD_bounds,
:ZSTD_cParam_getBounds,
:ZSTD_dParam_getBounds
)
@test Base.ispublic(ChunkCodecLibZstd, sym)
end
end
end