From: Peter Stephenson <pws@csr.com>
To: zsh-workers@zsh.org
Subject: Re: Fwd: Test Failure
Date: Wed, 20 Jan 2010 10:34:43 +0000 [thread overview]
Message-ID: <20100120103443.6c9dfd0c@news01> (raw)
In-Reply-To: <20a807211001191446y4a16143eg3014207f8c8e609c@mail.gmail.com>
On Tue, 19 Jan 2010 17:46:43 -0500
Vin Shelton <acs@alumni.princeton.edu> wrote:
> Since 2010-01-17, I've been getting a failure in the test suite:
>
> : build/zsh-2010-01-17 Tue 19 16:09; make check
> **************************************
> 37 successful test scripts, 1 failure, 0 skipped
> **************************************
> make[1]: *** [check] Error 1
> make[1]: Leaving directory `/home/opt/build/zsh-2010-01-17/Test'
> make: *** [check] Error 2
>
> C02 doesn't report an error, but it doesn't report a pass, either.
Looks like I got the new test wrong. It's a bit complicated because it's
not supposed to produce an error if the regex module isn't available.
The failure is because I screwed up the size of the allocations
for the new variables.
Index: Src/Modules/pcre.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/pcre.c,v
retrieving revision 1.17
diff -u -r1.17 pcre.c
--- Src/Modules/pcre.c 17 Jan 2010 21:51:34 -0000 1.17
+++ Src/Modules/pcre.c 20 Jan 2010 10:33:49 -0000
@@ -194,8 +194,8 @@
char **mbegin, **mend, **bptr, **eptr;
int i, *ipair;
- bptr = mbegin = zalloc(nelem+1);
- eptr = mend = zalloc(nelem+1);
+ bptr = mbegin = zalloc(sizeof(char*)*(nelem+1));
+ eptr = mend = zalloc(sizeof(char*)*(nelem+1));
for (ipair = ovec + 2, i = 0;
i < nelem;
Index: Src/Modules/regex.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/regex.c,v
retrieving revision 1.6
diff -u -r1.6 regex.c
--- Src/Modules/regex.c 17 Jan 2010 21:51:36 -0000 1.6
+++ Src/Modules/regex.c 20 Jan 2010 10:33:49 -0000
@@ -135,11 +135,11 @@
setiparam("MEND", offs + !isset(KSHARRAYS) - 1);
if (nelem) {
char **mbegin, **mend, **bptr, **eptr;
- bptr = mbegin = (char **)zalloc(nelem+1);
- eptr = mend = (char **)zalloc(nelem+1);
+ bptr = mbegin = (char **)zalloc(sizeof(char *)*(nelem+1));
+ eptr = mend = (char **)zalloc(sizeof(char *)*(nelem+1));
- for (m = matches + start, n = start;
- n <= (int)re.re_nsub;
+ for (m = matches + start, n = 0;
+ n < nelem;
++n, ++m, ++bptr, ++eptr)
{
char buf[DIGBUFSIZE];
Index: Test/C02cond.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/C02cond.ztst,v
retrieving revision 1.24
diff -u -r1.24 C02cond.ztst
--- Test/C02cond.ztst 17 Jan 2010 21:51:36 -0000 1.24
+++ Test/C02cond.ztst 20 Jan 2010 10:33:49 -0000
@@ -251,7 +251,7 @@
fi
0:regex tests shouldn't crash
- if zmodload -i zsh/regex 2>/dev/null; then
+ (if zmodload -i zsh/regex 2>/dev/null; then
string="this has stuff in it"
bad_regex=0
if [[ $string =~ "h([a-z]*) s([a-z]*) " ]]; then
@@ -259,7 +259,7 @@
print -r "regex variables MATCH MBEGIN MEND:
'$MATCH $MBEGIN $MEND'
should be:
- 'has stuff 6 15'" >&2
+ 'has stuff 6 15'"
bad_regex=1
else
results=("as 7 8" "tuff 11 14")
@@ -268,19 +268,20 @@
print -r "regex variables match[$i] mbegin[$i] mend[$i]:
'$match[$i] $mbegin[$i] $mend[$i]'
should be
- '$results[$i]'" >&2
+ '$results[$i]'"
+ bad_regex=1
break
fi
done
fi
+ (( bad_regex )) || print OK
else
- print -r "regex failed to match '$string'" >&2
+ print -r "regex failed to match '$string'"
fi
- (( bad_regex )) || print OK
else
# if it didn't load, tough, but not a test error
print OK
- fi
+ fi)
0:MATCH, MBEGIN, MEND, match, mbegin, mend
>OK
--
Peter Stephenson <pws@csr.com> Software Engineer
Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK
Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
prev parent reply other threads:[~2010-01-20 11:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20a807211001191316x79ce2ffeib91fdc59cdfcb189@mail.gmail.com>
[not found] ` <20a807211001191342i4b1d8d63o9bede714f1831477@mail.gmail.com>
[not found] ` <20a807211001191445x5924b63frc6916febda023502@mail.gmail.com>
2010-01-19 22:46 ` Vin Shelton
2010-01-20 10:34 ` Peter Stephenson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100120103443.6c9dfd0c@news01 \
--to=pws@csr.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).