Testing: grib_get_double_element

This commit is contained in:
Shahram Najm 2023-01-31 16:33:38 +00:00
parent e8e4fefed7
commit 5d288997a2
2 changed files with 18 additions and 8 deletions

View File

@ -62,8 +62,8 @@ int main(int argc, char** argv)
for (i = 0; i < 100; i++) {
/* get a particular data value */
GRIB_CHECK(grib_get_double_element(h, "values", i, &element_value), 0);
if (element_value != values[i]) {
printf("ERROR: element_value=%g != values[%d]=%g\n", element_value, i, values[i]);
exit(1);
}
}

View File

@ -14,12 +14,22 @@
. ./include.ctest.sh
infile=${data_dir}/grid_ieee.grib
infiles="
grid_ieee.grib
regular_latlon_surface_constant.grib2
gfs.complex.mvmu.grib2
constant_field.grib2
missing.grib2"
# if [ ! -f ${infile} ]
# then
# echo no data to test
# exit 1
# fi
if [ $HAVE_JPEG -eq 1 ]; then
infiles="jpeg.grib2 "$infiles
fi
$EXEC ${test_dir}/grib_double_cmp ${infile}
if [ $HAVE_AEC -eq 1 ]; then
infiles="ccsds.grib2 "$infiles
fi
for f in $infiles; do
infile=$data_dir/$f
$EXEC ${test_dir}/grib_double_cmp ${infile}
done