ECC-1093: Add ability to detect when flags has lowercase but not string_type

This commit is contained in:
Shahram Najm 2020-03-14 21:40:10 +00:00
parent ce991d0f7c
commit 6f1e6dfdea
1 changed files with 13 additions and 0 deletions

View File

@ -97,6 +97,19 @@ grib_action* grib_action_create_gen(grib_context* context, const char* name, con
act->cclass = c;
act->context = context;
act->flags = flags;
#if CHECK_LOWERCASE_AND_STRING_TYPE
{
int flag_lowercase=0, flag_stringtype=0;
if (flags & GRIB_ACCESSOR_FLAG_LOWERCASE)
flag_lowercase = 1;
if (flags & GRIB_ACCESSOR_FLAG_STRING_TYPE)
flag_stringtype = 1;
if (flag_lowercase && !flag_stringtype) {
printf("grib_action_create_gen name=%s. Has lowercase but not string_type\n", name);
Assert(0);
}
}
#endif
a = (grib_action_gen*)act;
a->len = len;