mirror of https://github.com/ecmwf/eccodes.git
Testing: grib_to_netcdf error conditions
This commit is contained in:
parent
cdb2e68f87
commit
a2bd712308
|
@ -104,8 +104,23 @@ echo "Test shuffle and deflate ..."
|
||||||
if [ $have_netcdf4 -eq 1 ]; then
|
if [ $have_netcdf4 -eq 1 ]; then
|
||||||
input=${data_dir}/sst_globus0083.grib
|
input=${data_dir}/sst_globus0083.grib
|
||||||
${tools_dir}/grib_to_netcdf -s -d9 -k4 -o $tempNetcdf $input
|
${tools_dir}/grib_to_netcdf -s -d9 -k4 -o $tempNetcdf $input
|
||||||
|
|
||||||
|
set +e
|
||||||
|
${tools_dir}/grib_to_netcdf -s -o $tempNetcdf $input > $tempText 2>&1
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "Invalid shuffle option. Deflate option needed" $tempText
|
||||||
|
|
||||||
|
set +e
|
||||||
|
${tools_dir}/grib_to_netcdf -s -dy -o $tempNetcdf $input > $tempText 2>&1
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "Invalid number" $tempText
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "Test ECC-1060 ..."
|
echo "Test ECC-1060 ..."
|
||||||
# ----------------------
|
# ----------------------
|
||||||
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl
|
||||||
|
@ -172,6 +187,16 @@ set -e
|
||||||
grep -q "not on a regular lat/lon grid or on a regular Gaussian grid" $tempText
|
grep -q "not on a regular lat/lon grid or on a regular Gaussian grid" $tempText
|
||||||
|
|
||||||
|
|
||||||
|
echo "No output ..."
|
||||||
|
# --------------------------
|
||||||
|
set +e
|
||||||
|
${tools_dir}/grib_to_netcdf $input > $tempText 2>&1
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "No output file" $tempText
|
||||||
|
|
||||||
|
|
||||||
# ECC-1783: No error message when input file has invalid fields
|
# ECC-1783: No error message when input file has invalid fields
|
||||||
input=$data_dir/bad.grib
|
input=$data_dir/bad.grib
|
||||||
set +e
|
set +e
|
||||||
|
|
|
@ -4294,6 +4294,7 @@ int grib_tool_finalise_action(grib_runtime_options* options)
|
||||||
int creation_mode = NC_CLOBBER;
|
int creation_mode = NC_CLOBBER;
|
||||||
|
|
||||||
if (options->outfile == NULL || options->outfile->name == NULL) {
|
if (options->outfile == NULL || options->outfile->name == NULL) {
|
||||||
|
grib_context_log(ctx, GRIB_LOG_ERROR, "No output file. Exiting!");
|
||||||
usage();
|
usage();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue