Blame SOURCES/TEST-validators_ut_check-Fix-fail-with-new-glibc.patch

787af7
From 9f9a3ded23cc2bb917468939b745cc498cec523a Mon Sep 17 00:00:00 2001
787af7
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
787af7
Date: Wed, 1 Aug 2018 17:48:10 +0200
787af7
Subject: [PATCH] validators_ut_check: Fix fail with new glibc
787af7
787af7
Error message was slightly change from previous version
787af7
of glibc which caused fails in validators unit tests.
787af7
787af7
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
787af7
---
787af7
 ini/ini_validators_ut_check.c | 13 +++++++++++--
787af7
 1 file changed, 11 insertions(+), 2 deletions(-)
787af7
787af7
diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c
787af7
index 9ecde75..3af8551 100644
787af7
--- a/ini/ini_validators_ut_check.c
787af7
+++ b/ini/ini_validators_ut_check.c
787af7
@@ -602,6 +602,8 @@ START_TEST(test_ini_allowed_options_wrong_regex)
787af7
     fail_unless(ret == 0, "Got msg: [%s]", errmsg);
787af7
     ini_errobj_next(errobj);
787af7
 
787af7
+    /* Different versions of libc produce slightly different error strings
787af7
+     * in this case. For simplicity compare against all of them. */
787af7
     errmsg = ini_errobj_get_msg(errobj);
787af7
     ret = strcmp(errmsg,
787af7
                  "[rule/options_for_foo]: Cannot compile regular expression "
787af7
@@ -609,10 +611,17 @@ START_TEST(test_ini_allowed_options_wrong_regex)
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
+                     "[rule/options_for_foo]: Cannot compile regular "
787af7
+		     "expression from option 'section_re'. "
787af7
                      "Error: 'brackets ([ ]) not balanced'");
787af7
     }
787af7
+
787af7
+    if (ret != 0) {
787af7
+         ret = strcmp(errmsg,
787af7
+                     "[rule/options_for_foo]: Cannot compile regular "
787af7
+		     "expression from option 'section_re'. "
787af7
+		     "Error: 'Unmatched [, [^, [:, [., or [='");
787af7
+    }
787af7
     fail_unless(ret == 0, "Got msg: [%s]", errmsg);
787af7
     ini_errobj_next(errobj);
787af7
 
787af7
-- 
787af7
2.9.5
787af7