mirror of https://github.com/ecmwf/eccodes.git
Testing: Improve error reporting
This commit is contained in:
parent
af10b60752
commit
ab072c1c82
|
@ -39,9 +39,15 @@ int main(int argc, char* argv[])
|
||||||
GRIB_CHECK(grib_get_native_type(h, name, &type), 0);
|
GRIB_CHECK(grib_get_native_type(h, name, &type), 0);
|
||||||
Assert( type > 0 && type < 7 );
|
Assert( type > 0 && type < 7 );
|
||||||
int ktype = grib_keys_iterator_get_native_type(kiter);
|
int ktype = grib_keys_iterator_get_native_type(kiter);
|
||||||
Assert(type == ktype);
|
if (type != ktype) {
|
||||||
|
fprintf(stderr, "ERROR: key=%s type=%s ktype=%s\n", name, grib_get_type_name(type), grib_get_type_name(ktype));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
const char* type_name = grib_get_type_name(type);
|
const char* type_name = grib_get_type_name(type);
|
||||||
Assert( !STR_EQUAL(type_name, "unknown") );
|
if (STR_EQUAL(type_name, "unknown")) {
|
||||||
|
fprintf(stderr, "ERROR: key=%s type is unknown!\n", name);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
printf("%s = %s (%d)\n", name, type_name, type);
|
printf("%s = %s (%d)\n", name, type_name, type);
|
||||||
|
|
||||||
if (STR_EQUAL(type_name, "label")) {
|
if (STR_EQUAL(type_name, "label")) {
|
||||||
|
|
Loading…
Reference in New Issue