mirror of https://github.com/ecmwf/eccodes.git
Testing: Error conditions
This commit is contained in:
parent
7e9a6b4078
commit
4ac5774626
|
@ -50,6 +50,36 @@ set -e
|
|||
grep -q "Key Nj cannot be 0" $tempText
|
||||
|
||||
|
||||
set +e
|
||||
${tools_dir}/grib_get -l 0,0,5 $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -ne 0 ]
|
||||
grep -q "Wrong mode given" $tempText
|
||||
|
||||
|
||||
set +e
|
||||
${tools_dir}/grib_get -l 0,0,1,nonexistingmask $ECCODES_SAMPLES_PATH/reduced_ll_sfc_grib1.tmpl > $tempText 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -ne 0 ]
|
||||
cat $tempText
|
||||
grep -q "unable to open mask file" $tempText
|
||||
|
||||
|
||||
# ------------------------
|
||||
# Unreadable message
|
||||
# ------------------------
|
||||
outfile=temp.$label.out
|
||||
echo GRIB > $outfile
|
||||
set +e
|
||||
${tools_dir}/grib_get -p edition $outfile /dev/null > $tempText 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -ne 0 ]
|
||||
grep -q "unreadable message" $tempText
|
||||
rm -f $outfile
|
||||
|
||||
|
||||
# Clean up
|
||||
rm -f $tempText
|
||||
|
|
|
@ -225,6 +225,8 @@ grib_check_key_equals $file 'expver:s' '0001'
|
|||
${tools_dir}/grib_ls -j -l0,0 -p referenceValue:d $data_dir/sample.grib2
|
||||
${tools_dir}/grib_ls -j -l0,0 -p referenceValue:i $data_dir/sample.grib2
|
||||
|
||||
${tools_dir}/grib_get -l0,0,4 $data_dir/sample.grib2
|
||||
|
||||
set +e
|
||||
${tools_dir}/grib_ls -l0,0,666 $data_dir/sample.grib2 > $tempText 2>&1
|
||||
status=$?
|
||||
|
@ -233,5 +235,13 @@ set -e
|
|||
grep -q "Wrong mode given" $tempText
|
||||
|
||||
|
||||
set +e
|
||||
${tools_dir}/grib_ls -l0,0,1,nonexistingmask $data_dir/sample.grib2 > $tempText 2>&1
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -ne 0 ]
|
||||
grep -q "unable to open mask file" $tempText
|
||||
|
||||
|
||||
# Clean up
|
||||
rm -f $temp1 $temp2 $tempText $tempLog
|
||||
|
|
Loading…
Reference in New Issue