From efdbd08c662f5cf2080a92c7e9cb0136c904e32e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 6 Feb 2020 10:53:54 +0000 Subject: [PATCH] ECC-992: Add test for decoding limits as doubles --- tests/grib_data_quality_checks.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/grib_data_quality_checks.sh b/tests/grib_data_quality_checks.sh index 0237f53f2..a3cae1196 100755 --- a/tests/grib_data_quality_checks.sh +++ b/tests/grib_data_quality_checks.sh @@ -27,7 +27,7 @@ sample_g2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl unset ECCODES_GRIB_DATA_QUALITY_CHECKS unset ECCODES_EXTRA_DEFINITION_PATH - +# These input files are 2m temperature with min=221.76 and max=311.619 input1=${data_dir}/reduced_gaussian_surface.grib1 input2=${data_dir}/reduced_gaussian_surface.grib2 grib_check_key_equals $input1 paramId 167 @@ -80,15 +80,18 @@ echo "Test limits which are doubles..." pid=151131 # has limits -3.5 and +3.5 ${tools_dir}/grib_set -s paramId=$pid $input1 $tempGrib1 ${tools_dir}/grib_set -s paramId=$pid $input2 $tempGrib2 -minval1=`${tools_dir}/grib_get -p param_value_min $tempGrib1` -maxval1=`${tools_dir}/grib_get -p param_value_max $tempGrib1` -minval2=`${tools_dir}/grib_get -p param_value_min $tempGrib2` -maxval2=`${tools_dir}/grib_get -p param_value_max $tempGrib2` +minval1=`${tools_dir}/grib_get -p param_value_min:d $tempGrib1` +maxval1=`${tools_dir}/grib_get -p param_value_max:d $tempGrib1` +minval2=`${tools_dir}/grib_get -p param_value_min:d $tempGrib2` +maxval2=`${tools_dir}/grib_get -p param_value_max:d $tempGrib2` [ "$minval1" = "-3.5" ] [ "$maxval1" = "3.5" ] [ "$minval2" = "-3.5" ] [ "$maxval2" = "3.5" ] +# Decode as strings +grib_check_key_equals $tempGrib2 'param_value_min:s,param_value_max:s' '-3.5 3.5' + set +e ${tools_dir}/grib_set -s scaleValuesBy=1.1 $tempGrib1 $tempOut 2>$tempErr stat1=$?