ECC-1115: Added basic test

This commit is contained in:
Shahram Najm 2020-05-18 18:16:11 +01:00
parent b468a914d7
commit 5ed4876e64
4 changed files with 33 additions and 4 deletions

View File

@ -178,10 +178,10 @@ static int unpack_string(grib_accessor* a, char* v, size_t* len)
earthMinorAxisInMetres = earthMajorAxisInMetres = radius; earthMinorAxisInMetres = earthMajorAxisInMetres = radius;
} }
/* Default: lat/lon grid */ if (strcmp(grid_type, "regular_ll") == 0) {
sprintf(v,"+proj=latlong +a=%lf +b=%lf", earthMajorAxisInMetres, earthMinorAxisInMetres); sprintf(v,"+proj=latlong +a=%lf +b=%lf", earthMajorAxisInMetres, earthMinorAxisInMetres);
}
if (strcmp(grid_type, "mercator") == 0) { else if (strcmp(grid_type, "mercator") == 0) {
double LaDInDegrees = 0; double LaDInDegrees = 0;
if ((err = grib_get_double_internal(h, "LaDInDegrees", &LaDInDegrees)) != GRIB_SUCCESS) if ((err = grib_get_double_internal(h, "LaDInDegrees", &LaDInDegrees)) != GRIB_SUCCESS)
return err; return err;

View File

@ -165,6 +165,7 @@ list(APPEND tests_data_reqd
grib_step grib_step
grib_set grib_set
grib_iterator grib_iterator
grib_proj_string
grib_compare grib_compare
grib_copy grib_copy
grib_level grib_level

View File

@ -41,6 +41,7 @@ TESTS = definitions.sh \
grib_step.sh \ grib_step.sh \
grib_set.sh \ grib_set.sh \
grib_iterator.sh \ grib_iterator.sh \
grib_proj_string.sh \
grib_compare.sh \ grib_compare.sh \
grib_level.sh \ grib_level.sh \
grib_indexing.sh \ grib_indexing.sh \

27
tests/grib_proj_string.sh Executable file
View File

@ -0,0 +1,27 @@
#!/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.sh
files="
mercator.grib2
satellite.grib
"
for f in `echo $files`; do
file=${data_dir}/$f
ps=`${tools_dir}/grib_get -wcount=1 -p projString $file`
# Check length of result is nonzero
[ -n "$ps" ]
done
# Reminder
keysfile=${proj_dir}/tests/keys
grep -q projString $keysfile