From bc8362f9850f31cadf79c34f82409b1783ae1fd1 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 14 Jan 2024 14:39:46 +0000 Subject: [PATCH] Testing: grib_util_set_spec packing types --- tests/grib_util_set_spec.cc | 2 ++ tests/grib_util_set_spec.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tests/grib_util_set_spec.cc b/tests/grib_util_set_spec.cc index cf254aff4..31af1bcb5 100644 --- a/tests/grib_util_set_spec.cc +++ b/tests/grib_util_set_spec.cc @@ -27,6 +27,8 @@ static int get_packing_type_code(const char* packingType) return GRIB_UTIL_PACKING_TYPE_GRID_SECOND_ORDER; else if (STR_EQUAL(packingType, "grid_ieee")) return GRIB_UTIL_PACKING_TYPE_IEEE; + else if (STR_EQUAL(packingType, "grid_complex")) + return GRIB_UTIL_PACKING_TYPE_GRID_COMPLEX; Assert(!"Invalid packingType"); return result; diff --git a/tests/grib_util_set_spec.sh b/tests/grib_util_set_spec.sh index 3daf5d0db..4f0b92cd5 100755 --- a/tests/grib_util_set_spec.sh +++ b/tests/grib_util_set_spec.sh @@ -74,6 +74,20 @@ if [ $HAVE_AEC -eq 1 ]; then grib_check_key_equals $outfile packingType grid_simple fi +infile=${data_dir}/sample.grib2 +$EXEC $grib_util_set_spec -p grid_ieee $infile $outfile +grib_check_key_equals $outfile 'packingType,precision' 'grid_ieee 1' + +infile=${data_dir}/sample.grib2 +$EXEC $grib_util_set_spec -p grid_second_order $infile $outfile +grib_check_key_equals $outfile 'packingType' 'grid_second_order' + +infile=${data_dir}/sample.grib2 +$EXEC $grib_util_set_spec -p grid_complex $infile $outfile +# $tools_dir/grib_ls $outfile +grib_check_key_equals $outfile 'packingType' 'grid_complex' + + # -------------------------------------------------- # Reduced Gaussian Grid N=32 second order packing # --------------------------------------------------