Testing: Accessor suppressed

This commit is contained in:
Shahram Najm 2024-02-15 15:22:32 +00:00
parent d2e0ac5768
commit 8c1719dadd
1 changed files with 15 additions and 36 deletions

View File

@ -17,19 +17,6 @@ tempFilt=temp.${label}.filt
tempRef=temp.${label}.ref
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
cat > $tempFilt <<EOF
meta a_deprecated_key suppressed(typeOfOriginalFieldValues);
print "[a_deprecated_key]";
EOF
set +e
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
status=$?
set -e
[ $status -ne 0 ]
cat $tempErr
cat > $tempRef <<EOF
ECCODES ERROR : key 'a_deprecated_key' is unavailable in this version.
ECCODES ERROR : Please use the following key(s):
@ -37,31 +24,23 @@ ECCODES ERROR : - typeOfOriginalFieldValues
ERROR: Key/value not found (message 1)
EOF
do_tests()
{
qualifier=$1
echo "meta a_deprecated_key suppressed(typeOfOriginalFieldValues); print \"[a_deprecated_key$qualifier]\";" > $tempFilt
set +e
${tools_dir}/grib_filter $tempFilt $sample2 2>$tempErr
status=$?
set -e
[ $status -ne 0 ]
cat $tempErr
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
do_tests ""
do_tests ":i"
do_tests ":d"
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