Testing: Accessors 'sum' and 'suppressed'

This commit is contained in:
Shahram Najm 2024-02-15 15:02:51 +00:00
parent d7111f0185
commit d2e0ac5768
2 changed files with 36 additions and 0 deletions

View File

@ -237,6 +237,19 @@ grib_check_key_equals $tempGrib scaleFactorOfFirstFixedSurface MISSING
grib_check_key_equals $tempGrib scaledValueOfFirstFixedSurface MISSING
echo "Test for the sum accessor"
# -------------------------------
input="${samp_dir}/reduced_gg_pl_32_grib2.tmpl"
cat >$tempFilt <<EOF
meta sum_of_pl_array sum(pl);
# Default is double
print "sum_of_pl_array =[sum_of_pl_array]";
print "sum_of_pl_array as ints=[sum_of_pl_array:i]";
print "sum_of_pl_array as strs=[sum_of_pl_array:s]";
EOF
${tools_dir}/grib_filter $tempFilt $input > $tempOut
echo "Test from_scale_factor_scaled_value"
# -----------------------------------------
input="${samp_dir}/reduced_gg_pl_32_grib2.tmpl"

View File

@ -39,6 +39,29 @@ EOF
diff $tempRef $tempErr
# Try decoding as int and double too
cat > $tempFilt <<EOF
meta a_deprecated_key suppressed(typeOfOriginalFieldValues);
print "[a_deprecated_key:i]";
EOF
set +e
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
status=$?
set -e
[ $status -ne 0 ]
grep -q "is unavailable" $tempErr
cat > $tempFilt <<EOF
meta a_deprecated_key suppressed(typeOfOriginalFieldValues);
print "[a_deprecated_key:d]";
EOF
set +e
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
status=$?
set -e
[ $status -ne 0 ]
grep -q "is unavailable" $tempErr
# Clean up
rm -f $tempFilt $tempErr $tempRef