Blame SOURCES/INI-Fix-detection-of-error-messages.patch

7ef858
From 72c19bd018b107ecf5a80963b433e9922f7243fd Mon Sep 17 00:00:00 2001
7ef858
From: Lukas Slebodnik <lslebodn@redhat.com>
7ef858
Date: Wed, 3 Jan 2018 18:03:44 +0100
7ef858
Subject: [PATCH 01/11] INI: Fix detection of error messages
7ef858
MIME-Version: 1.0
7ef858
Content-Type: text/plain; charset=UTF-8
7ef858
Content-Transfer-Encoding: 8bit
7ef858
7ef858
libc on BSD returns different error messages.
7ef858
7ef858
Reviewed-by: Michal Židek <mzidek@redhat.com>
7ef858
---
7ef858
 ini/ini_validators_ut_check.c | 11 +++++++++++
7ef858
 1 file changed, 11 insertions(+)
7ef858
7ef858
diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c
7ef858
index fa7105a..9ecde75 100644
7ef858
--- a/ini/ini_validators_ut_check.c
7ef858
+++ b/ini/ini_validators_ut_check.c
7ef858
@@ -607,6 +607,12 @@ START_TEST(test_ini_allowed_options_wrong_regex)
7ef858
                  "[rule/options_for_foo]: Cannot compile regular expression "
7ef858
                  "from option 'section_re'. "
7ef858
                  "Error: 'Unmatched [ or [^'");
7ef858
+    if (ret != 0) {
7ef858
+        ret = strcmp(errmsg,
7ef858
+                     "[rule/options_for_foo]: Cannot compile regular expression "
7ef858
+                     "from option 'section_re'. "
7ef858
+                     "Error: 'brackets ([ ]) not balanced'");
7ef858
+    }
7ef858
     fail_unless(ret == 0, "Got msg: [%s]", errmsg);
7ef858
     ini_errobj_next(errobj);
7ef858
 
7ef858
@@ -1028,6 +1034,11 @@ START_TEST(test_ini_allowed_sections_wrong_regex)
7ef858
     ret = strcmp(errmsg,
7ef858
                  "[rule/section_list]: Validator failed to use regex "
7ef858
                  "[^foo\\(*$]:[Unmatched ( or \\(]");
7ef858
+    if (ret !=0) {
7ef858
+        ret = strcmp(errmsg,
7ef858
+                     "[rule/section_list]: Validator failed to use regex "
7ef858
+                     "[^foo\\(*$]:[parentheses not balanced]");
7ef858
+    }
7ef858
     fail_unless(ret == 0, "Got msg: [%s]", errmsg);
7ef858
     ini_errobj_next(errobj);
7ef858
 
7ef858
-- 
7ef858
2.9.5
7ef858