Skip to content

Test for fits_read_descript #50

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

Merged
merged 2 commits into from
May 17, 2025
Merged
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
19 changes: 19 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1015,4 +1015,23 @@ end
@test names_read == names
end
end

@testset "variable length column in binary table" begin
tempfitsfile() do f
# Create a binary table with variable-length column
cols = [
("col1", "1PJ", ""),
]
fits_create_binary_tbl(f, 0, cols, "VARLEN")

data = Int32[10, 20, 30]
CFITSIO.fits_write_col(f, 1, 1, 1, data)

nelem, heap_offset = CFITSIO.fits_read_descript(f, 1, 1)

# Step 4: Assertions
@test nelem == 3
@test heap_offset ≥ 0 # Offset in heap should be non-negative
end
end
end
Loading