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

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