2014-09-01 12:20:22 +00:00
|
|
|
#!/bin/sh
|
2020-01-28 14:32:34 +00:00
|
|
|
# (C) Copyright 2005- ECMWF.
|
2014-09-01 12:20:22 +00:00
|
|
|
#
|
|
|
|
# This software is licensed under the terms of the Apache Licence Version 2.0
|
|
|
|
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
|
|
|
|
#
|
|
|
|
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
|
|
|
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
|
|
|
#
|
|
|
|
|
2022-04-03 22:02:48 +00:00
|
|
|
. ./include.ctest.sh
|
2014-09-01 12:20:22 +00:00
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
|
|
|
|
|
|
|
cat > bufrdc_desc_ref.filter<<EOF
|
|
|
|
print "[bufrdcExpandedDescriptors!1''%06d]";
|
|
|
|
EOF
|
|
|
|
|
2015-03-13 17:51:03 +00:00
|
|
|
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
|
|
|
|
for bf in ${bufr_files}
|
2014-09-01 12:20:22 +00:00
|
|
|
do
|
2015-03-13 17:51:03 +00:00
|
|
|
file=${data_dir}/bufr/$bf
|
2014-09-01 12:20:22 +00:00
|
|
|
|
|
|
|
# Test descriptors: compare output of filter (res) with reference file (ref)
|
|
|
|
res_desc=$file.desc.test
|
|
|
|
ref_desc=$file.desc.ref
|
|
|
|
diff_desc=$file.desc.diff
|
|
|
|
|
|
|
|
rm -f $res_desc
|
|
|
|
|
2017-02-03 14:21:24 +00:00
|
|
|
${tools_dir}/codes_bufr_filter bufrdc_desc_ref.filter $file 2> $REDIRECT > $res_desc
|
2015-03-20 19:10:26 +00:00
|
|
|
if [ -f "$ref_desc" ]; then
|
|
|
|
diff $ref_desc $res_desc > $diff_desc 2> $diff_desc
|
|
|
|
fi
|
2014-09-01 12:20:22 +00:00
|
|
|
rm -f $res_desc $diff_desc
|
|
|
|
done
|
|
|
|
|
2023-07-08 21:10:17 +00:00
|
|
|
# ECC-1631: Segmentation fault: Decode bufrdcExpandedDescriptors as string
|
|
|
|
echo 'print "[bufrdcExpandedDescriptors:s]";' | ${tools_dir}/codes_bufr_filter - $ECCODES_SAMPLES_PATH/BUFR4.tmpl
|
|
|
|
|
|
|
|
|
|
|
|
# Clean up
|
2014-09-01 12:20:22 +00:00
|
|
|
rm -f bufrdc_desc_ref.filter
|