ini/ini.d/merge.validator | 11 ----------- ini/ini_augment.c | 11 +++++------ ini/ini_validators_ut_check.c | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ini/ini.d/merge.validator b/ini/ini.d/merge.validator index 1defe8e..017c1cb 100644 --- a/ini/ini.d/merge.validator +++ b/ini/ini.d/merge.validator @@ -1,17 +1,8 @@ -File %s%s/merge.validator did not match provided patterns. Skipping. -File %s%s/real8.conf did not match provided patterns. Skipping. -File %s%s/new_line.conf did not match provided patterns. Skipping. -File %s%s/real32be.conf did not match provided patterns. Skipping. -File %s%s/real32le.conf did not match provided patterns. Skipping. -File %s%s/real16be.conf did not match provided patterns. Skipping. -File %s%s/real16le.conf did not match provided patterns. Skipping. -File %s%s/foo.conf.in did not match provided patterns. Skipping. Errors detected while parsing: %s%s/comment.conf. Error (9) on line 22: Invalid space character at the beginning of the line. Error (9) on line 24: Invalid space character at the beginning of the line. Error (9) on line 26: Invalid space character at the beginning of the line. Error (15) on line 32: Incomplete comment at the end of the file. -No sections found in file %s%s/comment.conf. Skipping. Section [section_a] found in file %s%s/first.conf is not allowed. Section [section_c] found in file %s%s/first.conf is not allowed. Section [section_b] found in file %s%s/first.conf is not allowed. @@ -42,7 +33,6 @@ Error (9) on line 1: Invalid space character at the beginning of the line. Error (9) on line 2: Invalid space character at the beginning of the line. Error (9) on line 3: Invalid space character at the beginning of the line. Error (9) on line 4: Invalid space character at the beginning of the line. -No sections found in file %s%s/space.conf. Skipping. Section [info] found in file %s%s/symbols.conf is not allowed. Section [languages] found in file %s%s/symbols.conf is not allowed. Section [text] found in file %s%s/symbols.conf is not allowed. @@ -55,6 +45,5 @@ Error (9) on line 15: Invalid space character at the beginning of the line. Error (9) on line 16: Invalid space character at the beginning of the line. Error (9) on line 26: Invalid space character at the beginning of the line. Error (9) on line 35: Invalid space character at the beginning of the line. -No sections found in file %s%s/test.conf. Skipping. %s%s/ipa.conf %s%s/real.conf diff --git a/ini/ini_augment.c b/ini/ini_augment.c index af5c0b6..5a5a173 100644 --- a/ini/ini_augment.c +++ b/ini/ini_augment.c @@ -456,10 +456,9 @@ static int ini_aug_construct_list(char *dirname , } } else { - ini_aug_add_string(ra_err, - "File %s did not match provided patterns." - " Skipping.", - fullname); + TRACE_INFO_STRING("File did not match provided patterns." + " Skipping:", + fullname); } } @@ -609,8 +608,8 @@ static int ini_aug_match_sec(struct ini_cfgobj *snip_cfg, /* Just in case check that we processed anything */ if (section_count == 0) { - ini_aug_add_string(ra_err, "No sections found in file %s. Skipping.", - snip_name); + TRACE_INFO_STRING("No sections found in file. Skipping:", + snip_name); *skip = true; TRACE_FLOW_EXIT(); return EOK; diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c index fa7105a..3af8551 100644 --- a/ini/ini_validators_ut_check.c +++ b/ini/ini_validators_ut_check.c @@ -602,11 +602,26 @@ START_TEST(test_ini_allowed_options_wrong_regex) fail_unless(ret == 0, "Got msg: [%s]", errmsg); ini_errobj_next(errobj); + /* Different versions of libc produce slightly different error strings + * in this case. For simplicity compare against all of them. */ errmsg = ini_errobj_get_msg(errobj); ret = strcmp(errmsg, "[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'"); + } + + if (ret != 0) { + ret = strcmp(errmsg, + "[rule/options_for_foo]: Cannot compile regular " + "expression from option 'section_re'. " + "Error: 'Unmatched [, [^, [:, [., or [='"); + } fail_unless(ret == 0, "Got msg: [%s]", errmsg); ini_errobj_next(errobj); @@ -1028,6 +1043,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);