mirror of https://github.com/ecmwf/eccodes.git
Testing: Check descriptor code: FXY must be 6 digits
This commit is contained in:
parent
d825769d43
commit
2b6e5af279
|
@ -12,6 +12,7 @@
|
||||||
#include "grib_api_internal.h"
|
#include "grib_api_internal.h"
|
||||||
|
|
||||||
static const size_t MIN_NUM_COLUMNS = 8;
|
static const size_t MIN_NUM_COLUMNS = 8;
|
||||||
|
static const size_t NUM_DESCRIPTOR_DIGITS = 6; /* FXY */
|
||||||
|
|
||||||
#define NUMBER(a) (sizeof(a) / sizeof(a[0]))
|
#define NUMBER(a) (sizeof(a) / sizeof(a[0]))
|
||||||
static const char* allowed_types[] = { "long", "double", "table", "flag", "string" };
|
static const char* allowed_types[] = { "long", "double", "table", "flag", "string" };
|
||||||
|
@ -73,6 +74,11 @@ int main(int argc, char** argv)
|
||||||
line_number, str_code);
|
line_number, str_code);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (strlen(str_code) != NUM_DESCRIPTOR_DIGITS) {
|
||||||
|
fprintf(stderr, "Error on line %lu: descriptor code '%s' (column 1) is not %lu digits.\n",
|
||||||
|
line_number, str_code, NUM_DESCRIPTOR_DIGITS);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
str_key = list[1];
|
str_key = list[1];
|
||||||
str_type = list[2];
|
str_type = list[2];
|
||||||
if (check_descriptor_type(str_type) != GRIB_SUCCESS) {
|
if (check_descriptor_type(str_type) != GRIB_SUCCESS) {
|
||||||
|
|
Loading…
Reference in New Issue