From f8eb65e3be06b2f50b658423dc30ce8e7eb61098 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 25 Jan 2021 15:44:30 +0000 Subject: [PATCH] ECC-539: Add tests --- tests/grib_copy.sh | 12 +++++++++++- tests/grib_set.sh | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/grib_copy.sh b/tests/grib_copy.sh index cc93fc088..4b7f21f23 100755 --- a/tests/grib_copy.sh +++ b/tests/grib_copy.sh @@ -44,7 +44,7 @@ r2=`${tools_dir}/grib_get -n ls $temp` [ "$r1" = "$r2" ] -echo "Test: ECC-1086..." +echo "Test: ECC-1086 invalid message ..." # ------------------------- # This file is 179 bytes long. We chop the last byte to create # an invalid GRIB message (Final 7777 is 777) @@ -80,6 +80,16 @@ set -e count=`${tools_dir}/grib_count $temp` [ $count -eq 43 ] + +echo "Test: ECC-539 input=output ..." +# ----------------------- +set +e +${tools_dir}/grib_copy $temp $temp +status=$? +set -e +[ $status -ne 0 ] + + #${tools_dir}/grib_copy -w count=1 -X 57143 $input $temp #Last msg #r1=`${tools_dir}/grib_get -w count=37 -n ls $input` #r2=`${tools_dir}/grib_get -n ls $temp` diff --git a/tests/grib_set.sh b/tests/grib_set.sh index 31e945110..325d4168e 100755 --- a/tests/grib_set.sh +++ b/tests/grib_set.sh @@ -72,5 +72,11 @@ done ${tools_dir}/grib_set -s centre=289 $ECCODES_SAMPLES_PATH/GRIB2.tmpl $outfile ${tools_dir}/grib_dump -O $outfile | grep -q 'centre = 289.*Zambia' +# ECC-539: avoid output being the same as input +set +e +${tools_dir}/grib_set -s centre=0 $outfile $outfile +status=$? +set -e +[ $status -ne 0 ] rm -f $outfile