ECC-1938: Test

This commit is contained in:
shahramn 2024-11-09 11:36:01 +00:00
parent 2b0730694c
commit 234d21692d
3 changed files with 39 additions and 0 deletions

View File

@ -13,6 +13,7 @@ string(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}")
# Exceptional case: download bufr files which have to be treated specially # Exceptional case: download bufr files which have to be treated specially
list(APPEND bufr_files_to_download "vos308014_v3_26.bufr") # See test ecc-197 list(APPEND bufr_files_to_download "vos308014_v3_26.bufr") # See test ecc-197
list(APPEND bufr_files_to_download "bad.bufr") # See ECC-1938
if( ENABLE_EXTRA_TESTS ) if( ENABLE_EXTRA_TESTS )
ecbuild_get_test_multidata( ecbuild_get_test_multidata(

View File

@ -258,6 +258,7 @@ if( HAVE_BUILD_TOOLS )
bufr_ecc-1476 bufr_ecc-1476
bufr_ecc-1623 bufr_ecc-1623
bufr_ecc-1785 bufr_ecc-1785
bufr_ecc-1938
grib_ecc-490 grib_ecc-490
grib_ecc-756 grib_ecc-756
grib_ecc-806 grib_ecc-806

37
tests/bufr_ecc-1938.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# 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.
#
. ./include.ctest.sh
REDIRECT=/dev/null
label="bufr_ecc-1938_test"
tempBufr=temp.$label.bufr
tempLog=temp.$label.log
tempOut=temp.$label.txt
sample_bufr4=$ECCODES_SAMPLES_PATH/BUFR4.tmpl
infile=${data_dir}/bufr/bad.bufr
if [ -f "$infile" ]; then
count=$( ${tools_dir}/bufr_count -f $infile )
[ $count -eq 24 ]
set +e
${tools_dir}/bufr_copy $infile $tempBufr
status=$?
set -e
[ $status -ne 0 ]
count=$( ${tools_dir}/bufr_count $tempBufr )
[ $count -eq 24 ]
fi
# Clean up
rm -f $tempBufr $tempLog $tempOut