From 6e4caaa0b1f3434a9d77a7a2567243f58351d452 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 30 Oct 2023 16:35:13 +0000 Subject: [PATCH] Testing: invalid grid input --- tests/grib_copy_message.cc | 2 ++ tests/grib_to_netcdf.sh | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/tests/grib_copy_message.cc b/tests/grib_copy_message.cc index 0fd6bb021..b3ea95cdc 100644 --- a/tests/grib_copy_message.cc +++ b/tests/grib_copy_message.cc @@ -23,6 +23,8 @@ int main(int argc, char* argv[]) assert (argc == 3); + printf("%ld\n", codes_get_api_version()); + in = fopen(argv[1], "rb"); assert(in); diff --git a/tests/grib_to_netcdf.sh b/tests/grib_to_netcdf.sh index e83f9a620..c07dc89e9 100755 --- a/tests/grib_to_netcdf.sh +++ b/tests/grib_to_netcdf.sh @@ -148,6 +148,16 @@ set -e [ $status -ne 0 ] grep -q "Wrong number of fields" $tempText +# Not regular grid +input=${data_dir}/reduced_gaussian_pressure_level.grib2 +set +e +${tools_dir}/grib_to_netcdf -o $tempNetcdf $input > $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "not on a regular lat/lon grid or on a regular Gaussian grid" $tempText + + export GRIB_TO_NETCDF_CHECKVALIDTIME=0 ${tools_dir}/grib_to_netcdf -o $tempNetcdf $tempGrib [ -f "$tempNetcdf" ]