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:
parent
65bfda445d
commit
922630f76f
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user