From 8dd89b059d131e9d4e4b74dae08c3eba73bfc8f7 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 1 Feb 2021 16:36:34 +0000 Subject: [PATCH] Testing: Add test to detect missing version entry in 1.0.table --- tests/grib2_version.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/grib2_version.sh b/tests/grib2_version.sh index 4fa6df36a..780bd5356 100755 --- a/tests/grib2_version.sh +++ b/tests/grib2_version.sh @@ -18,6 +18,7 @@ if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then fi temp=temp.$label.grib2 +sample1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl tables_dir="$ECCODES_DEFINITION_PATH/grib2/tables" @@ -31,4 +32,13 @@ if [ "$latest" != "$highest_num" ]; then exit 1 fi +# Also grib1 to grib2 conversion should set the correct version +${tools_dir}/grib_set -s edition=2 $sample1 $temp +tv=`${tools_dir}/grib_get -p tablesVersion $temp` +if [ "$tv" != "$latest" ]; then + echo "After conversion to GRIB2, tablesVersion=$tv. Should be $latest. Check definitions/grib2/tables/1.0.table" + exit 1 +fi +# grib_check_key_equals $temp tablesVersion $latest + rm -f $temp