mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
2f0a6d22e9
re: Github Issue https://github.com/Unidata/netcdf-c/issues/1826 It turns out that the common get code (NC4_get_vars) in libhdf5 (and libnczarr) has an optimization where it does not attempt to read from the file if the file is all fill values. Rather it just fills the output buffer with the fill value. The problem is that -- in that case -- it forgets that conversion might still be needed. So the conversion never occurs and the raw bits of the fill data are stored directly into the memory space. Solution: move some code around to properly do the conversion no matter how the data was obtained. Added a test cases nc_test4/test_fillonly.sh and nczarr_test/test_fillonlyz.sh
18 lines
386 B
Bash
Executable File
18 lines
386 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
|
. ../test_common.sh
|
|
|
|
# This shell script tests bug reported in github issue
|
|
# https://github.com/Unidata/netcdf-c/issues/1826
|
|
|
|
set -e
|
|
|
|
echo ""
|
|
echo "*** Testing data conversions when a variable has fill value but never written"
|
|
|
|
${NCGEN} -4 -b -o tmp_fillonly.nc $srcdir/ref_fillonly.cdl
|
|
${execdir}/tst_fillonly${ext}
|
|
|
|
exit 0
|