From 4f752c488014e43c6419ff36e2e26611c010f411 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 16 Feb 2022 17:33:38 +0000 Subject: [PATCH] ECC-1352: GRIB CCSDS packing: Add extra tests (Part 3) --- samples/ccsds_grib2.tmpl | Bin 0 -> 183 bytes tests/grib_ccsds.sh | 22 ++++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 samples/ccsds_grib2.tmpl diff --git a/samples/ccsds_grib2.tmpl b/samples/ccsds_grib2.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..d8ac1127fa3a18b3f80c7896c9b36ceb86d5299c GIT binary patch literal 183 zcmZ<{@^t$DpMi-10=5GwQAUO&1_l-eM)vE>;ygeBkfaAQkYM}(Bp4X}qXM9a01(T= zq?jkSgP05kAcFDa;RXh|76=CNl~_QcK=8i-NHBs}j7Y`-xst44i?r+;7#JG3KnnO2 R7=UaBHn#sjl9k;Y2msGbF%$p* literal 0 HcmV?d00001 diff --git a/tests/grib_ccsds.sh b/tests/grib_ccsds.sh index d3b896d17..611e52d81 100755 --- a/tests/grib_ccsds.sh +++ b/tests/grib_ccsds.sh @@ -10,22 +10,28 @@ . ./include.sh +label="grib_ccsds_test" REDIRECT=/dev/null -# Disable if autotools being used -src_config=${src_dir}/config.h -if [ -f ${src_config} ]; then - exit 0 -fi - BLACKLIST="totalLength,section5Length,section7Length,dataRepresentationTemplateNumber" infile=${data_dir}/ccsds.grib2 -outfile1=$infile.tmp_ccsds.1 -outfile2=$infile.tmp_ccsds.2 +outfile1=temp.$label.1 +outfile2=temp.$label.2 rm -f $outfile1 $outfile2 +# Use the sample file with CCSDS packing +# --------------------------------------- +sample_ccsds=$ECCODES_SAMPLES_PATH/ccsds_grib2.tmpl +${tools_dir}/grib_filter -o $outfile1 - $sample_ccsds << EOF + set values = { 55.0161, 99.7008 }; + write; +EOF +grib_check_key_equals $outfile1 packingType grid_ccsds +stats=`${tools_dir}/grib_get -M -F%.4f -p min,max $outfile1` +[ "$stats" = "55.0161 99.7008" ] + # ECC-1263 # --------- grib2_sample=$ECCODES_SAMPLES_PATH/gg_sfc_grib2.tmpl