add test for fix for Jira NCF-131

This commit is contained in:
Dennis Heimbigner 2011-12-13 03:08:56 +00:00
parent b7f74c9cb4
commit 66488a4773
5 changed files with 168 additions and 2 deletions

View File

@ -28,7 +28,7 @@ if !BUILD_DLL
check_PROGRAMS = rewrite-scalar ctest ctest64 ncdump tst_utf8
TESTS = run_tests.sh tst_64bit.sh ctest ctest64 tst_output.sh \
tst_lengths.sh tst_calendars.sh tst_utf8 run_utf8_tests.sh \
tst_nccopy3.sh
tst_nccopy3.sh tst_charfill.sh
if USE_NETCDF4
# NetCDF-4 has some extra tests.
@ -66,7 +66,8 @@ tst_string_data.cdl tst_fillbug.cdl tst_opaque_data.cdl \
tst_compounds4.cdl tst_utf8.cdl tst_compounds3.cdl \
tst_special_atts.cdl tst_nans.cdl tst_format_att_64.cdl \
tst_vlen_data.cdl tst_solar_1.cdl tst_format_att.cdl tst_inflated.nc \
tmp_subset.cdl tst_inflated4.nc tst_deflated.nc tst_chunking.nc tmp*.nc
tmp_subset.cdl tst_inflated4.nc tst_deflated.nc tst_chunking.nc tmp*.nc \
tst_charfill.nc tmp_tst_charfill.cdl
# These files all have to be included with the distribution.
EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \

View File

@ -0,0 +1,74 @@
netcdf tst_charfill {
dimensions:
STRING2 = 2 ;
STRING4 = 4 ;
STRING8 = 8 ;
STRING16 = 16 ;
STRING32 = 32 ;
STRING256 = 256 ;
iseq = UNLIMITED ; // (36 currently)
variables:
int SEQUENCE(iseq) ;
SEQUENCE:long_name = "PRG sequence number" ;
SEQUENCE:units = "" ;
SEQUENCE:conventions = "" ;
SEQUENCE:_FillValue = 0 ;
SEQUENCE:missing_value = 0 ;
SEQUENCE:valid_min = 1 ;
SEQUENCE:valid_max = 150000 ;
SEQUENCE:tables = "results perform users comment" ;
char IDENTIFIER(iseq, STRING32) ;
IDENTIFIER:long_name = "Standard|sample identifier " ;
IDENTIFIER:units = "" ;
IDENTIFIER:conventions = "standard|G. species; left justified" ;
IDENTIFIER:_FillValue = "" ;
IDENTIFIER:tables = "results" ;
// global attributes:
:version = "02a" ;
:version_date = 20060501 ;
:create_date = 20040323 ;
:inew_start = 92586 ;
data:
SEQUENCE = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 ;
IDENTIFIER =
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"" ;
}

View File

@ -22,6 +22,7 @@ variables:
char cscalar;
double dscalar;
char cnodata(i);
cnodata:_Fillvalue = "";
byte bnodata(i);
short snodata(i);
int inodata(i);

72
ncdump/tst_charfill.cdl Normal file
View File

@ -0,0 +1,72 @@
netcdf tst_charfill {
dimensions:
STRING2 = 2 ;
STRING4 = 4 ;
STRING8 = 8 ;
STRING16 = 16 ;
STRING32 = 32 ;
STRING256 = 256 ;
iseq = UNLIMITED ; // (0 currently)
variables:
int SEQUENCE(iseq) ;
SEQUENCE:long_name = "PRG sequence number" ;
SEQUENCE:units = "" ;
SEQUENCE:conventions = "" ;
SEQUENCE:_FillValue = 0 ;
SEQUENCE:missing_value = 0 ;
SEQUENCE:valid_min = 1 ;
SEQUENCE:valid_max = 150000 ;
SEQUENCE:tables = "results perform users comment" ;
char IDENTIFIER(iseq, STRING32) ;
IDENTIFIER:long_name = "Standard|sample identifier " ;
IDENTIFIER:units = "" ;
IDENTIFIER:conventions = "standard|G. species; left justified" ;
IDENTIFIER:_FillValue = "";
IDENTIFIER:tables = "results" ;
// global attributes:
:version = "02a" ;
:version_date = 20060501 ;
:create_date = 20040323 ;
:inew_start = 92586 ;
data:
SEQUENCE =
1
,2
,3
,4
,5
,6
,7
,8
,9
,10
,11
,12
,13
,14
,15
,16
,17
,18
,19
,20
,21
,22
,23
,24
,25
,26
,27
,28
,29
,30
,31
,32
,33
,34
,35
,36
;
}

18
ncdump/tst_charfill.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# This shell script runs an ncgen buf in handling character _Fillvalue.
set -e
echo ""
echo "*** Running char _Fillvalue bug test."
echo "*** Create tst_charfill.nc from tst_charfill.cdl..."
rm -f tst_charfill.nc tmp_tst_charfill.cdl
../ncgen/ncgen -b tst_charfill.cdl
echo "*** dumping tst_charfill.nc to tmp_tst_charfill.cdl..."
./ncdump tst_charfill.nc > tmp_tst_charfill.cdl
echo "*** comparing tmp_tst_charfill.cdl with ref_tst_charfill.cdl..."
diff tmp_tst_charfill.cdl $srcdir/ref_tst_charfill.cdl
echo
echo "*** All char _Fillvalue bug test for netCDF-4 format passed!"
exit 0