Testing: Increase coverage

This commit is contained in:
Shahram Najm 2023-08-24 17:59:02 +01:00
parent 21a37f25f5
commit 5b06296dce
2 changed files with 37 additions and 0 deletions

View File

@ -40,6 +40,7 @@ ${tools_dir}/grib_ls -l 0,0,1 $infile >> $tempLog
${tools_dir}/grib_get -l 0,0,1 $infile >> $tempLog ${tools_dir}/grib_get -l 0,0,1 $infile >> $tempLog
${tools_dir}/grib_get -p count,step $infile >> $tempLog ${tools_dir}/grib_get -p count,step $infile >> $tempLog
${tools_dir}/grib_get -P count $infile >> $tempLog ${tools_dir}/grib_get -P count $infile >> $tempLog
${tools_dir}/grib_get -i 0 $infile
files=" reduced_gaussian_lsm.grib1 files=" reduced_gaussian_lsm.grib1
reduced_gaussian_model_level.grib1 reduced_gaussian_model_level.grib1
@ -207,5 +208,16 @@ grib_check_key_equals $file 'expver:d' 1
grib_check_key_equals $file 'expver:s' '0001' 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
set +e
${tools_dir}/grib_ls -l0,0,666 $data_dir/sample.grib2 > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Wrong mode given" $tempText
# Clean up # Clean up
rm -f $temp1 $temp2 $tempText $tempLog rm -f $temp1 $temp2 $tempText $tempLog

View File

@ -18,6 +18,8 @@ temp=temp.grib_set.out
rm -f $outfile rm -f $outfile
${tools_dir}/grib_set -V
${tools_dir}/grib_set -v -p levtype,centre,levtype,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT ${tools_dir}/grib_set -v -p levtype,centre,levtype,centre:l -s levtype=pl,centre=80 $infile $outfile >$REDIRECT
levtype=`${tools_dir}/grib_get -p levtype $outfile` levtype=`${tools_dir}/grib_get -p levtype $outfile`
@ -85,6 +87,17 @@ set -e
[ $status -ne 0 ] [ $status -ne 0 ]
grep -q "Trying to encode a negative value of -1 for key of type unsigned" $temp grep -q "Trying to encode a negative value of -1 for key of type unsigned" $temp
# Bad value for -d
# ----------------
input=${data_dir}/reduced_gaussian_sub_area.grib2
set +e
${tools_dir}/grib_set -d hello $input $outfile 2>$temp
status=$?
set -e
[ $status -ne 0 ]
grep -q "Invalid number" $temp
# ECC-1605: Out-of-bounds value for signed keys # ECC-1605: Out-of-bounds value for signed keys
# ---------------------------------------------------- # ----------------------------------------------------
if [ $ECCODES_ON_WINDOWS -eq 0 ]; then if [ $ECCODES_ON_WINDOWS -eq 0 ]; then
@ -196,5 +209,17 @@ count=`${tools_dir}/grib_count $outfile`
grib_check_key_equals $outfile shortName '2t' grib_check_key_equals $outfile shortName '2t'
# ------------------------
# Unreadable message
# ------------------------
echo GRIB > $outfile
set +e
${tools_dir}/grib_set -s edition=2 $outfile /dev/null > $temp 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "unreadable message" $temp
# Clean up # Clean up
rm -f $outfile $temp rm -f $outfile $temp