Skip to content

Commit

Permalink
Add Julia 1.11 nightly to tests (#1146)
Browse files Browse the repository at this point in the history
* Add Julia 1.11 nightly to tests

* Fix reinterpret arrays due to JuliaLang/julia#51962

* Mark Windows virtual dataset tests as broken
  • Loading branch information
mkitti committed Apr 5, 2024
1 parent 6f5a0f8 commit 126adc1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
version:
- '1.6'
- '1'
- '1.11-nightly'
- 'nightly'
os:
- ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,20 @@ function write_dataset(
end
end
end

function write_dataset(
dataset::Dataset,
memtype::Datatype,
buf::Base.ReinterpretArray,
xfer::DatasetTransferProperties=dataset.xfer
) where {T}
# We cannot obtain a pointer of a ReinterpretArrayin Julia 1.11 and beyond
# https://github.com/JuliaLang/julia/issues/51962
buf_copy = copy(buf)
@assert !(typeof(buf_copy) <: Base.ReinterpretArray) "Copying $(typeof(buf)) resulted in another Base.ReinterpretArray"
write_dataset(dataset, memtype, buf_copy, xfer)
end

function write_dataset(
dataset::Dataset,
memtype::Datatype,
Expand Down
9 changes: 7 additions & 2 deletions test/virtual_dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@ using Test, HDF5
virtual=[HDF5.VirtualMapping(vspace, "./sub-%b.hdf5", "x", srcspace)]
)

@test size(d) == (3, 2)
@test read(d) == hcat(fill(1.0, 3), fill(2.0, 3))
if Sys.iswindows()
@test_broken size(d) == (3, 2)
@test_broken read(d) == hcat(fill(1.0, 3), fill(2.0, 3))
else
@test size(d) == (3, 2)
@test read(d) == hcat(fill(1.0, 3), fill(2.0, 3))
end

dcpl = HDF5.get_create_properties(d)

Expand Down

0 comments on commit 126adc1

Please sign in to comment.