From 70b2799dcd115f50ba36a60e1b2491356eee7da2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 2 Sep 2023 15:37:33 +0100 Subject: [PATCH] Testing: Increase coverage --- tests/grib_set.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/grib_set.sh b/tests/grib_set.sh index 8e448c8d9..1b8be144b 100755 --- a/tests/grib_set.sh +++ b/tests/grib_set.sh @@ -208,6 +208,22 @@ count=`${tools_dir}/grib_count $outfile` [ $count -eq 1 ] grib_check_key_equals $outfile shortName '2t' +# Key with no_fail flag +# ------------------------ +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +grib_check_key_equals $input 'typeOfProcessedData:i' '2' +${tools_dir}/grib_set -s typeOfProcessedData=rubbish $input $outfile +grib_check_key_equals $outfile 'typeOfProcessedData:i' '255' # set to default + +# Codetable mismatch +# ------------------------ +input=$ECCODES_SAMPLES_PATH/GRIB2.tmpl +set +e +${tools_dir}/grib_set -s stepUnits=d $input $outfile > $temp 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "stepUnits: No such code table entry.*Did you mean" $temp # ------------------------ # Unreadable message