Testing: grib_get_data error conditions

This commit is contained in:
shahramn 2024-08-26 16:00:43 +01:00
parent f985cf7806
commit 1e4249dceb
1 changed files with 16 additions and 0 deletions

View File

@ -153,6 +153,22 @@ input=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl
ECCODES_DEBUG=1 ${tools_dir}/grib_get_data $input > $tempText 2>&1
grep "global num points=6114" $tempText
# Bad -s
set +e
${tools_dir}/grib_get_data -s blah=999 $data_dir/sample.grib2 > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Key/value not found" $tempText
# Bad -p
set +e
${tools_dir}/grib_get_data -f -p values $data_dir/sample.grib2 > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Passed array is too small" $tempText
# Clean up
rm -f $tempText $tempGrib