Testing: Invalid key decoding

This commit is contained in:
Shahram Najm 2023-06-26 15:50:25 +01:00
parent ddd81e2f4f
commit 7932e4ac6a
1 changed files with 18 additions and 0 deletions

View File

@ -80,5 +80,23 @@ ${tools_dir}/grib_set -s gridType=polar_stereographic $grib2_sample $tempGrib
${tools_dir}/grib_get -p projString $tempGrib > $tempText
grep -q "proj=stere" $tempText
# Test invalid decode
set +e
${tools_dir}/grib_get -p projString:i $grib2_sample > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "ERROR.*Cannot unpack projTargetString as long" $tempText
grep -q "Hint: Try unpacking as string" $tempText
set +e
${tools_dir}/grib_get -p projString:d $grib2_sample > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "ERROR.*Cannot unpack projTargetString as double" $tempText
grep -q "Hint: Try unpacking as string" $tempText
# Clean up
rm -f $tempGrib $tempText