MXS-3019: Fix enum value validation

Also added a test case that reproduces the problem and verifies that it is
fixed.
This commit is contained in:
Markus Mäkelä 2020-06-01 20:35:22 +03:00
parent 65bfda445d
commit 922630f76f
No known key found for this signature in database
GPG Key ID: 5CE746D557ACC499
2 changed files with 5 additions and 0 deletions

View File

@ -4535,6 +4535,10 @@ bool config_param_is_valid(const MXS_MODULE_PARAM* params,
/** Either the only defined enum value is not valid
* or multiple values were defined */
valid = false;
}
if (!valid)
{
break;
}
}

View File

@ -91,6 +91,7 @@ int test_validity()
TEST(config_param_is_valid(params, "p5", "c,a,b", &ctx));
TEST(!config_param_is_valid(params, "p5", "d", &ctx));
TEST(!config_param_is_valid(params, "p5", "a,d", &ctx));
TEST(!config_param_is_valid(params, "p5", "d,a", &ctx));
TEST(!config_param_is_valid(params, "p5", "a,b,c,d", &ctx));
/** Path parameter */