From 6f1e6dfdea8ddc533de83a2e7db75d545ad7e912 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 14 Mar 2020 21:40:10 +0000 Subject: [PATCH] ECC-1093: Add ability to detect when flags has lowercase but not string_type --- src/action_class_gen.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/action_class_gen.c b/src/action_class_gen.c index ffa305a5f..0068dae93 100644 --- a/src/action_class_gen.c +++ b/src/action_class_gen.c @@ -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;