From 993cc42e4c032299ffd627c6973550304567c73f Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Fri, 13 Oct 2023 12:28:32 +0100 Subject: [PATCH] ECC-1704: Test --- tests/grib_step.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/grib_step.sh b/tests/grib_step.sh index 2b1ca37b6..0a5cf7425 100755 --- a/tests/grib_step.sh +++ b/tests/grib_step.sh @@ -17,6 +17,9 @@ tempGrb=${data_dir}/temp.$label.out.grib templog=${data_dir}/temp.$label.log rm -f $templog $tempGrb +grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl +grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl + for i in 0 10 do for s in 0 1200 600 6000 @@ -83,8 +86,6 @@ hourEnd=$1; dayEnd=$2 # ECC-134 case-sensitivity # -------------------------- -grib1_sample=$ECCODES_SAMPLES_PATH/GRIB1.tmpl -grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl temp=temp.step.$$.grib # M is for Month (code 3) ${tools_dir}/grib_set -s indicatorOfUnitOfTimeRange=M $grib1_sample $temp @@ -147,6 +148,14 @@ grib_check_key_equals $input "dataDate,dataTime,step" "20061205 1200 6" grib_check_key_equals $input "validityDate,validityTime" "20061205 1800" grib_check_key_equals $input "validityDateTime:s" "20061205 001800" +# ECC-1704: Key validityTime as string +# ----------------------------------------------- +result=$( ${tools_dir}/grib_get -p validityTime:s -s dataTime=0000 $grib2_sample ) +[ "$result" = "0000" ] +input=$data_dir/simple.grib +grib_check_key_equals $input "validityTime:s" "0600" + + # Key julianDay # ----------------------------------------------- input=${data_dir}/sample.grib2 @@ -157,7 +166,6 @@ grib_check_key_equals $temp day 7 # Seconds (ignored) # ----------------------------------------------- -grib2_sample=$ECCODES_SAMPLES_PATH/GRIB2.tmpl ${tools_dir}/grib_ls -s second=9 -n time $grib2_sample 2>$templog # Something should have been written to stderr [ -s $templog ]