mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
Fix missing files
This commit is contained in:
parent
0349acbc87
commit
7e48f2ad7b
8
nczarr_test/ref_scalar.cdl
Normal file
8
nczarr_test/ref_scalar.cdl
Normal file
@ -0,0 +1,8 @@
|
||||
netcdf ref_scalar {
|
||||
variables:
|
||||
int v ;
|
||||
v:_FillValue = -1 ;
|
||||
data:
|
||||
|
||||
v = 17 ;
|
||||
}
|
21
nczarr_test/ref_string_nczarr.baseline
Normal file
21
nczarr_test/ref_string_nczarr.baseline
Normal 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" ;
|
||||
}
|
22
nczarr_test/ref_string_zarr.baseline
Normal file
22
nczarr_test/ref_string_zarr.baseline
Normal 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
60
nczarr_test/run_scalar.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user