CCSDS: Add test for data quality checks

This commit is contained in:
Shahram Najm 2022-05-18 21:32:32 +01:00
parent df2f153fc7
commit a3b6bb31e7
1 changed files with 13 additions and 1 deletions

View File

@ -9,7 +9,7 @@
#
. ./include.ctest.sh
set -u
# ---------------------------------------------------------
# Tests for data quality checks
# ---------------------------------------------------------
@ -22,6 +22,7 @@ tempGrib2=temp.${label}.grib2
sample_g1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl
sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
sample_ccsds=$ECCODES_SAMPLES_PATH/ccsds_grib2.tmpl
# Start with clean environment
unset ECCODES_GRIB_DATA_QUALITY_CHECKS
@ -194,8 +195,19 @@ ${tools_dir}/grib_set -s paramId=260509,scaleValuesBy=1000 $sample_g2 $tempGrib2
status=$?
set -e
[ $status -ne 0 ]
unset ECCODES_EXTRA_DEFINITION_PATH
# Check CCSDS encoding too
# -------------------------
export ECCODES_GRIB_DATA_QUALITY_CHECKS=1
set +e
${tools_dir}/grib_set -s scaleValuesBy=1000 $sample_ccsds $tempGrib2 2>$tempErr
status=$?
set -e
[ $status -ne 0 ]
grep -q "maximum (1000) is more than the allowable limit" $tempErr
# Clean up
rm -rf $tempDir