ding-libs/TEST-validators_ut_check-Fix-fail-with-new-glibc.patch
Jan Engelhardt 26dfb1f16c Accepting request 704658 from home:scarabeus_iv:branches:network:ldap
- Update to 0.6.1:
  * No upstream changelog
- Update URL
  * Remove the git link info as it 404 atm
- Add patches from upstream to fix ini behaviour:
  * INI-Fix-detection-of-error-messages.patch
  * INI-Silence-ini_augment-match-failures.patch
  * TEST-validators_ut_check-Fix-fail-with-new-glibc.patch

OBS-URL: https://build.opensuse.org/request/show/704658
OBS-URL: https://build.opensuse.org/package/show/network:ldap/ding-libs?expand=0&rev=35
2019-05-23 12:01:13 +00:00

50 lines
1.9 KiB
Diff

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