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

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