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

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