2021-05-17 16:07:08 +00:00
|
|
|
#!/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.
|
|
|
|
#
|
|
|
|
|
2022-04-03 22:02:48 +00:00
|
|
|
. ./include.ctest.sh
|
2022-06-06 14:41:18 +00:00
|
|
|
|
2021-05-17 16:07:08 +00:00
|
|
|
# ---------------------------------------------------------
|
|
|
|
# This is the test for the JIRA issue ECC-922
|
|
|
|
# grib_get_data should fail on incorrectly coded grid
|
|
|
|
# ---------------------------------------------------------
|
|
|
|
|
|
|
|
REDIRECT=/dev/null
|
2022-06-06 14:41:18 +00:00
|
|
|
label="grib_ecc-922_test"
|
2021-05-17 16:07:08 +00:00
|
|
|
temp=temp.$label
|
|
|
|
sample_grib2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
|
|
|
|
|
|
|
# Create an inconsistent grid: j scans negatively but lat1 < lat2
|
|
|
|
${tools_dir}/grib_set -s latitudeOfFirstGridPoint=0,latitudeOfLastGridPoint=60000000 $sample_grib2 $temp
|
|
|
|
grib_check_key_equals $temp jScansPositively 0
|
|
|
|
# grib_get_data should fail
|
|
|
|
set +e
|
|
|
|
${tools_dir}/grib_get_data $temp
|
|
|
|
status=$?
|
|
|
|
set -e
|
|
|
|
[ $status -ne 0 ]
|
|
|
|
|
|
|
|
|
|
|
|
rm -f $temp
|