summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 03:33:41 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-25 03:33:41 +0000
commit66dfcf4efb68ace12d46e5a71a169ed8e8f432b8 (patch)
tree64a501e1003f125a5d433b8b825fa1d5272744a4
parentcac6ed4e68078655bf86749d86eb4330541ef4e6 (diff)
test/regex/tst-regex2.c: fix the rest of testsuite failures
-rw-r--r--libc/misc/regex/regex_old.c13
-rw-r--r--test/README4
2 files changed, 16 insertions, 1 deletions
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index e2824eda5..6bdd07f14 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -6099,7 +6099,18 @@ byte_re_match_2_internal (
{ /* No. So allocate them with malloc. We need one
extra element beyond `num_regs' for the `-1' marker
GNU code uses. */
- regs->num_regs = MIN (RE_NREGS, num_regs + 1);
+// regex specs say:
+// "If REGS_UNALLOCATED, allocate space in the regs structure
+// for max(RE_NREGS, re_nsub + 1) groups"
+// but real-world testsuites fail with contrived examples
+// with lots of groups.
+// I don't see why we can't just allocate exact needed number.
+// Incidentally, it makes RE_NREGS unused.
+//
+// regs->num_regs = MAX (RE_NREGS, num_regs + 1); - VERY WRONG
+// regs->num_regs = MIN (RE_NREGS, num_regs + 1); - slightly less wrong
+// good one which passes uclibc test/regex/tst-regex2.c:
+ regs->num_regs = num_regs + 1;
regs->start = TALLOC (regs->num_regs, regoff_t);
regs->end = TALLOC (regs->num_regs, regoff_t);
if (regs->start == NULL || regs->end == NULL)
diff --git a/test/README b/test/README
index 2bc92ab4b..31db8f410 100644
--- a/test/README
+++ b/test/README
@@ -19,11 +19,15 @@ make all
This will build and run tests.
The following make variables may help you in testing:
+
- UCLIBC_ONLY - only run tests against uClibc
- GLIBC_ONLY - only run tests against glibc
- V / VERBOSE - run tests with a lot of output
- TEST_INSTALLED_UCLIBC - Test installed libraries
under /lib and /usr/lib.
+ - TIMEOUTFACTOR=nn - increase test timeout nn times.
+ At least REGEX_OLD + regex/tst-regex2 needs it increased.
+
So, to just run the uClibc tests, try this:
make check UCLIBC_ONLY=1