From a3b6bb31e71b3d40660cfac4730dea0697cf2e26 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 18 May 2022 21:32:32 +0100 Subject: [PATCH] CCSDS: Add test for data quality checks --- tests/grib_data_quality_checks.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index 5347fff92..a20444325 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -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