ECC-245: tests

This commit is contained in:
Shahram Najm 2016-04-08 13:31:24 +01:00
parent c1ef73a611
commit dfb1033a0f
1 changed files with 21 additions and 3 deletions

View File

@ -17,11 +17,12 @@ outfile=${infile}.compare.$$
rm -f $outfile || true
${tools_dir}grib_set -s shortName=2d $infile $outfile
${tools_dir}grib_set -s shortName=2d $infile $outfile
${tools_dir}grib_compare -b indicatorOfParameter,paramId,shortName $infile $outfile > $REDIRECT
# Test the -r switch
# ----------------------------------------
infile=${data_dir}/v.grib2
for i in 1 2 3; do
${tools_dir}grib_copy -wcount=$i $infile temp_comp.$i
@ -32,12 +33,29 @@ cat temp_comp.3 temp_comp.2 temp_comp.1 > temp_comp.321
# Compare files in which the messages are not in the same order
${tools_dir}grib_compare -r temp_comp.123 temp_comp.321
rm -f temp_comp.1 temp_comp.2 temp_comp.3 temp_comp.123 temp_comp.321
# GRIB-797: test last argument being a directory
# ----------------------------------------
temp_dir=tempdir.grib_compare
mkdir -p $temp_dir
cp $infile $temp_dir
${tools_dir}grib_compare $infile $temp_dir
rm -rf $temp_dir
rm -f temp_comp.1 temp_comp.2 temp_comp.3 temp_comp.123 temp_comp.321
rm -f $outfile || true
# ECC-245: blacklist and 2nd order packing
# ----------------------------------------
temp1=grib_compare_temp1.grib1
temp2=grib_compare_temp2.grib1
${tools_dir}grib_copy -w count=25 ${data_dir}/lfpw.grib1 $temp1
${tools_dir}grib_copy -w count=30 ${data_dir}/lfpw.grib1 $temp2
# This should fail but not crash! so check exit code is not 134
set +e
${tools_dir}grib_compare -b firstOrderValues $temp1 $temp2 >/dev/null
status=$?
set -e
[ $status -eq 1 ]
rm -f $temp1 $temp2
rm -f $outfile