Fix missing files

This commit is contained in:
Dennis Heimbigner 2022-09-03 14:57:48 -06:00
parent 0349acbc87
commit 7e48f2ad7b
4 changed files with 111 additions and 0 deletions

View File

@ -0,0 +1,8 @@
netcdf ref_scalar {
variables:
int v ;
v:_FillValue = -1 ;
data:
v = 17 ;
}

View File

@ -0,0 +1,21 @@
netcdf ref_string {
dimensions:
d2 = 2 ;
variables:
char c(d2) ;
string v(d2) ;
string truncated ;
truncated:_nczarr_maxstrlen = 4 ;
// global attributes:
string :stringattr = "abc", "def" ;
:charattr = "ghijkl" ;
:_nczarr_default_maxstrlen = 6 ;
data:
c = "ab" ;
v = "uvw", "xyz" ;
truncated = "0123" ;
}

View File

@ -0,0 +1,22 @@
netcdf ref_string {
dimensions:
d2 = 2 ;
_scalar_ = 1 ;
variables:
char c(d2) ;
string truncated(_scalar_) ;
truncated:_nczarr_maxstrlen = 4 ;
string v(d2) ;
// global attributes:
:stringattr = "[\"abc\",\"def\"]" ;
:charattr = "ghijkl" ;
:_nczarr_default_maxstrlen = 6 ;
data:
c = "ab" ;
truncated = "0123" ;
v = "uvw", "xyz" ;
}

60
nczarr_test/run_scalar.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
. "$srcdir/test_nczarr.sh"
# This shell script tests support for the NC_STRING type
set -e
zarrscalar() {
rm -f $2
sed -e '/dimensions:/d' -e '/_scalar_ =/d' -e '/int v/ s|(_scalar_)||' <$1 >$2
}
testcase() {
zext=$1
echo "*** Test: scalar write/read"
# Get pure zarr args
fileargs tmp_scalar_zarr "mode=zarr,$zext"
zarrurl="$fileurl"
zarrfile="$file"
# Get nczarr args
fileargs tmp_scalar_nczarr "mode=nczarr,$zext"
nczarrurl="$fileurl"
nczarrfile="$file"
# setup
deletemap $zext $zarrfile
deletemap $zext $nczarrfile
# Create alternate ref files
echo "*** create pure zarr file"
${NCGEN} -4 -b -o "$zarrurl" $srcdir/ref_scalar.cdl
echo "*** create nczarr file"
${NCGEN} -4 -b -o "$nczarrurl" $srcdir/ref_scalar.cdl
echo "*** read purezarr"
${NCDUMP} -n ref_scalar $zarrurl > tmp_scalar_zarr0_${zext}.cdl
${ZMD} -h $zarrurl > tmp_scalar_zarr_${zext}.txt
echo "*** read nczarr"
${NCDUMP} -n ref_scalar $nczarrurl > tmp_scalar_nczarr_${zext}.cdl
${ZMD} -h $nczarrurl > tmp_scalar_nczarr_${zext}.txt
echo "*** verify"
diff -bw ref_scalar.cdl tmp_scalar_nczarr_${zext}.cdl
# Fixup
zarrscalar tmp_scalar_zarr0_${zext}.cdl tmp_scalar_zarr_${zext}.cdl
diff -bw ref_scalar.cdl tmp_scalar_zarr_${zext}.cdl
}
testcase file
if test "x$FEATURE_NCZARR_ZIP" = xyes ; then testcase zip; fi
if test "x$FEATURE_S3TESTS" = xyes ; then testcase s3; fi
exit 0