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