ECC-1260: test case

This commit is contained in:
Shahram Najm 2021-06-27 13:30:24 +01:00
parent a04b01bee0
commit 9932f9fb41
2 changed files with 46 additions and 0 deletions

View File

@ -86,6 +86,7 @@ if( HAVE_BUILD_TOOLS )
grib_ecc-1230
grib_ecc-1255
grib_ecc-1258
grib_ecc-1260
bufr_ecc-1028
bufr_ecc-1195
bufr_ecc-1259

45
tests/grib_ecc-1260.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
set -u
REDIRECT=/dev/null
label="grib_ecc-1260-test"
tempGrib=temp.$label.grib
tempRef=temp.$label.ref
tempOut=temp.$label.txt
sample_grib1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
# Create a GRIB with a stepRange having a hyphen
${tools_dir}/grib_set -s stepType=avg,productionStatusOfProcessedData=6,typeOfProcessedData=3,stepRange=0-24 \
$sample_grib2 $tempGrib
grib_check_key_equals $tempGrib step,stepRange "0-24 0-24"
# Put the average first
${tools_dir}/grib_get -p step $tempGrib $sample_grib2 > $tempOut
cat > $tempRef << EOF
0-24
0
EOF
diff $tempRef $tempOut
# Put the instantaneous first
${tools_dir}/grib_get -p step $sample_grib2 $tempGrib > $tempOut
cat > $tempRef << EOF
0
0-24
EOF
diff $tempRef $tempOut
# Clean up
rm -f $tempRef $tempGrib $tempOut