mirror of https://github.com/ecmwf/eccodes.git
Testing: Lambert/SpaceView error conditions
This commit is contained in:
parent
1b430aff47
commit
061dc1b77f
|
@ -187,15 +187,12 @@ grib_action* grib_action_create_concept(grib_context* context,
|
||||||
|
|
||||||
static void dump(grib_action* act, FILE* f, int lvl)
|
static void dump(grib_action* act, FILE* f, int lvl)
|
||||||
{
|
{
|
||||||
int i = 0;
|
for (int i = 0; i < lvl; i++)
|
||||||
|
|
||||||
for (i = 0; i < lvl; i++)
|
|
||||||
grib_context_print(act->context, f, " ");
|
grib_context_print(act->context, f, " ");
|
||||||
|
|
||||||
printf("concept(%s) { ", act->name);
|
printf("concept(%s) { \n", act->name);
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
for (i = 0; i < lvl; i++)
|
for (int i = 0; i < lvl; i++)
|
||||||
grib_context_print(act->context, f, " ");
|
grib_context_print(act->context, f, " ");
|
||||||
printf("}\n");
|
printf("}\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,5 +86,24 @@ ${tools_dir}/grib_get_data $tempGrib > $tempOut
|
||||||
${tools_dir}/grib_ls -l 40.44,353.56 $tempGrib
|
${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
|
# Clean up
|
||||||
rm -f $tempFilt $tempGrib $tempOut
|
rm -f $tempFilt $tempGrib $tempOut
|
||||||
|
|
|
@ -50,6 +50,14 @@ ${tools_dir}/grib_get_data $tempGrib2 > $tempOut
|
||||||
${tools_dir}/grib_ls -l 50,0 $tempGrib2
|
${tools_dir}/grib_ls -l 50,0 $tempGrib2
|
||||||
|
|
||||||
# Invalid cases
|
# 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
|
set +e
|
||||||
${tools_dir}/grib_get_data -sNr=missing $tempGrib2 > $tempOut 2>&1
|
${tools_dir}/grib_get_data -sNr=missing $tempGrib2 > $tempOut 2>&1
|
||||||
status=$?
|
status=$?
|
||||||
|
@ -64,6 +72,22 @@ set -e
|
||||||
[ $status -ne 0 ]
|
[ $status -ne 0 ]
|
||||||
grep -q "must be greater than zero" $tempOut
|
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
|
rm -f $tempGrib2 $tempOut
|
||||||
|
|
||||||
# -----------
|
# -----------
|
||||||
|
|
Loading…
Reference in New Issue