From 889385e3da6f9e7fd7fe827f64adf58a4eb803d1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 27 Dec 2023 19:29:31 +0000 Subject: [PATCH] Testing: bufr_compare errors --- tests/bufr_compare.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/bufr_compare.sh b/tests/bufr_compare.sh index b0fe1382c..fb0b11ea9 100755 --- a/tests/bufr_compare.sh +++ b/tests/bufr_compare.sh @@ -45,7 +45,7 @@ f1="syno_1.bufr" f2="aaen_55.bufr" echo "Test: comparing two completely different files" >> $fLog echo "file: $f" >> $fLog -${tools_dir}/bufr_compare $f1 $f2 >> $fLog +${tools_dir}/bufr_compare -v $f1 $f2 >> $fLog if [ $? -eq 0 ]; then echo "bufr_compare should have failed if files are completely different" >&2 exit 1 @@ -310,6 +310,24 @@ set -e ${tools_dir}/bufr_compare -bident -v $tempIndex1 $tempIndex2 rm -f $tempIndex1 $tempIndex2 +# Fail to unpack +# --------------- +bufr1=vos308014_v3_26.bufr +bufr2=aaen_55.bufr +set +e +${tools_dir}/bufr_compare $bufr1 $bufr2 > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Failed to unpack 1st message" $fLog + +set +e +${tools_dir}/bufr_compare $bufr2 $bufr1 > $fLog 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Failed to unpack 2nd message" $fLog + # Clean up # -------------