diff --git a/src/action_class_concept.cc b/src/action_class_concept.cc index d974e7ab9..fa639c54c 100644 --- a/src/action_class_concept.cc +++ b/src/action_class_concept.cc @@ -187,15 +187,12 @@ grib_action* grib_action_create_concept(grib_context* context, static void dump(grib_action* act, FILE* f, int lvl) { - int i = 0; - - for (i = 0; i < lvl; i++) + for (int i = 0; i < lvl; i++) grib_context_print(act->context, f, " "); - printf("concept(%s) { ", act->name); - printf("\n"); + printf("concept(%s) { \n", act->name); - for (i = 0; i < lvl; i++) + for (int i = 0; i < lvl; i++) grib_context_print(act->context, f, " "); printf("}\n"); } diff --git a/tests/grib_grid_lambert_conformal.sh b/tests/grib_grid_lambert_conformal.sh index 11d273d23..df4a3f9ec 100755 --- a/tests/grib_grid_lambert_conformal.sh +++ b/tests/grib_grid_lambert_conformal.sh @@ -86,5 +86,24 @@ ${tools_dir}/grib_get_data $tempGrib > $tempOut ${tools_dir}/grib_ls -l 40.44,353.56 $tempGrib +# Error conditions +# ---------------- +set +e +${tools_dir}/grib_get_data -s Latin1=5000,Latin2=-5000 $tempGrib > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Cannot have equal latitudes for standard parallels on opposite sides of equator" $tempOut + + +set +e +${tools_dir}/grib_get_data -s Ni=8 $tempGrib > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + + + # Clean up rm -f $tempFilt $tempGrib $tempOut diff --git a/tests/grib_grid_space_view.sh b/tests/grib_grid_space_view.sh index 03407053d..ff00db519 100755 --- a/tests/grib_grid_space_view.sh +++ b/tests/grib_grid_space_view.sh @@ -50,6 +50,14 @@ ${tools_dir}/grib_get_data $tempGrib2 > $tempOut ${tools_dir}/grib_ls -l 50,0 $tempGrib2 # Invalid cases +# -------------- +set +e +${tools_dir}/grib_get_data -s Nx=1 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Wrong number of points" $tempOut + set +e ${tools_dir}/grib_get_data -sNr=missing $tempGrib2 > $tempOut 2>&1 status=$? @@ -64,6 +72,22 @@ set -e [ $status -ne 0 ] grep -q "must be greater than zero" $tempOut + +set +e +${tools_dir}/grib_get_data -s latitudeOfSubSatellitePoint=66 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "satellite must be located in the equator plane" $tempOut + + +set +e +${tools_dir}/grib_get_data -s dx=0 $tempGrib2 > $tempOut 2>&1 +status=$? +set -e +[ $status -ne 0 ] +grep -q "Keys dx and dy must be greater than zero" $tempOut + rm -f $tempGrib2 $tempOut # -----------