Skip to content

Commit

Permalink
INI: Fix detection of error messages
Browse files Browse the repository at this point in the history
libc on BSD returns different error messages.

Reviewed-by: Michal Židek <[email protected]>
  • Loading branch information
Lukas Slebodnik authored and mzidek-gh committed Jan 10, 2018
1 parent 8fc5226 commit 72c19bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ini/ini_validators_ut_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,12 @@ START_TEST(test_ini_allowed_options_wrong_regex)
"[rule/options_for_foo]: Cannot compile regular expression "
"from option 'section_re'. "
"Error: 'Unmatched [ or [^'");
if (ret != 0) {
ret = strcmp(errmsg,
"[rule/options_for_foo]: Cannot compile regular expression "
"from option 'section_re'. "
"Error: 'brackets ([ ]) not balanced'");
}
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
ini_errobj_next(errobj);

Expand Down Expand Up @@ -1028,6 +1034,11 @@ START_TEST(test_ini_allowed_sections_wrong_regex)
ret = strcmp(errmsg,
"[rule/section_list]: Validator failed to use regex "
"[^foo\\(*$]:[Unmatched ( or \\(]");
if (ret !=0) {
ret = strcmp(errmsg,
"[rule/section_list]: Validator failed to use regex "
"[^foo\\(*$]:[parentheses not balanced]");
}
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
ini_errobj_next(errobj);

Expand Down

0 comments on commit 72c19bd

Please sign in to comment.