diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index e77367961..63edee393 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -56,7 +56,7 @@ set -e # Test: comparing with and without the -b switch #---------------------------------------------------- f="syno_1.bufr" -echo "Test: comparing with and witout the -b switch" >> $fLog +echo "Test: comparing with and without the -b switch" >> $fLog echo "file: $f" >> $fLog #Alter a key in the file @@ -92,6 +92,7 @@ ${tools_dir}/bufr_compare -b dataCategory $f ${fBufrTmp}>> $fLog #---------------------------------------------------- # Change subCentre and compare #---------------------------------------------------- +echo "Test: Change subCentre and compare" >> $fLog ${tools_dir}/bufr_set -s bufrHeaderSubCentre=12 aaen_55.bufr $fBufrTmp set +e ${tools_dir}/bufr_compare aaen_55.bufr $fBufrTmp > $fLog 2>&1 @@ -100,9 +101,23 @@ set -e [ $status -eq 1 ] fgrep -q "[bufrHeaderSubCentre]: [70] != [12]" $fLog +#---------------------------------------------------- +# First argument of bufr_compare is a directory (error) +#---------------------------------------------------- +echo "Test: First argument of bufr_compare is a directory (error)" >> $fLog +temp_dir=tempdir.${label} +mkdir -p $temp_dir +set +e +${tools_dir}/bufr_compare $temp_dir aaen_55.bufr >/dev/null +status=$? +set -e +[ $status -eq 1 ] +rm -fr $temp_dir + #---------------------------------------------------- # Second argument of bufr_compare is a directory #---------------------------------------------------- +echo "Test: Second argument of bufr_compare is a directory" >> $fLog temp_dir=tempdir.${label} mkdir -p $temp_dir infile=aaen_55.bufr @@ -113,6 +128,7 @@ rm -fr $temp_dir #---------------------------------------------------- # Compare attributes #---------------------------------------------------- +echo "Test: Compare attributes" >> $fLog set +e ${tools_dir}/bufr_compare amv2_87.bufr amv3_87.bufr > $fLog 2>&1 status=$? @@ -124,8 +140,9 @@ grep -q "#1#windSpeed->percentConfidence" $fLog grep -q "#1#coldestClusterTemperature->percentConfidence" $fLog #---------------------------------------------------- -# Header only mode +# Header-only mode #---------------------------------------------------- +echo "Test: Header-only mode" >> $fLog f="syno_1.bufr" cat > $fRules <> $fLog f=$ECCODES_SAMPLES_PATH/BUFR3.tmpl # Add a local section ${tools_dir}/bufr_set -s section2Present=1 $f $fBufrTmp @@ -156,16 +174,17 @@ set -e #---------------------------------------------------- # ECC-656: using relative comparison (-R) with 'all' #---------------------------------------------------- +echo "Test: ECC-656: using relative comparison (-R) with 'all'" >> $fLog f='airc_142.bufr' echo 'set unpack=1;set airTemperature=228; set height=1.037e+04; set pack=1; write;' |\ ${tools_dir}/codes_bufr_filter -o $fBufrTmp - $f ${tools_dir}/bufr_compare -R airTemperature=0.004,height=0.001 $f $fBufrTmp ${tools_dir}/bufr_compare -R all=0.004 $f $fBufrTmp -#---------------------------------------------------- -# ECC-658: apply relative comparison (-R) to all -# ranks of a given key -#---------------------------------------------------- +#-------------------------------------------------------------------- +# ECC-658: apply relative comparison (-R) to all ranks of a given key +#-------------------------------------------------------------------- +echo "Test: ECC-658: apply relative comparison (-R) to all ranks of a given key" >> $fLog f='PraticaTemp.bufr' ${tools_dir}/codes_bufr_filter -o $fBufrTmp - $f <> $fLog diff --git a/tests/metar_compare.sh b/tests/metar_compare.sh index 3322d0d4a..fece81678 100755 --- a/tests/metar_compare.sh +++ b/tests/metar_compare.sh @@ -48,7 +48,7 @@ if [ $status -eq 0 ]; then fi #---------------------------------------------------- -# Test: comparing with and witout the -b switch +# Test: comparing with and without the -b switch #---------------------------------------------------- # ${tools_dir}/metar_compare -b GG $metar_file $fMetarTmp >> $fLog