public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix a thinko in tst-rxspencer
@ 2003-11-21  0:28 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2003-11-21  0:28 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

Hi!

In the patch posted yesterday I made a thinko in tst-rxspencer,
rather than not running unnecessary tests, I just skipped replacing
characters which were not present at all.
The following patch on top of that should really only run tests
where something not yet tested can be checked.

2003-11-21  Jakub Jelinek  <jakub@redhat.com>

	* posix/tst-rxspencer.c (mb_tests): Don't run identical multi-byte
	tests multiple times unnecessarily.

--- libc/posix/tst-rxspencer.c.jj	2003-11-20 14:56:22.000000000 +0100
+++ libc/posix/tst-rxspencer.c	2003-11-21 01:17:00.000000000 +0100
@@ -357,22 +357,34 @@ mb_tests (const char *pattern, int cflag
   for (i = 1; i < 16; ++i)
     {
       char *p = letters;
-      if ((i & 1)
-	  && (strchr (pattern, 'a') || strchr (string, 'a')
-	      || strchr (pattern, 'A') || strchr (string, 'A')))
-	*p++ = 'a', *p++ = 'A';
-      if ((i & 2)
-	  && (strchr (pattern, 'b') || strchr (string, 'b')
-	      || strchr (pattern, 'B') || strchr (string, 'B')))
-        *p++ = 'b', *p++ = 'B';
-      if ((i & 4)
-	  && (strchr (pattern, 'c') || strchr (string, 'c')
-	      || strchr (pattern, 'C') || strchr (string, 'C')))
-        *p++ = 'c', *p++ = 'C';
-      if ((i & 8)
-	  && (strchr (pattern, 'd') || strchr (string, 'd')
-	      || strchr (pattern, 'D') || strchr (string, 'D')))
-        *p++ = 'd', *p++ = 'D';
+      if (i & 1)
+	{
+	  if (!strchr (pattern, 'a') && !strchr (string, 'a')
+	      && !strchr (pattern, 'A') && !strchr (string, 'A'))
+	    continue;
+	  *p++ = 'a', *p++ = 'A';
+	}
+      if (i & 2)
+	{
+	  if (!strchr (pattern, 'b') && !strchr (string, 'b')
+	      && !strchr (pattern, 'B') && !strchr (string, 'B'))
+	    continue;
+	  *p++ = 'b', *p++ = 'B';
+	}
+      if (i & 4)
+	{
+	  if (!strchr (pattern, 'c') && !strchr (string, 'c')
+	      && !strchr (pattern, 'C') && !strchr (string, 'C'))
+	    continue;
+	  *p++ = 'c', *p++ = 'C';
+	}
+      if (i & 8)
+	{
+	  if (!strchr (pattern, 'd') && !strchr (string, 'd')
+	      && !strchr (pattern, 'D') && !strchr (string, 'D'))
+	    continue;
+	  *p++ = 'd', *p++ = 'D';
+	}
       *p++ = '\0';
       sprintf (fail, "UTF-8 %s FAIL", letters);
       ret |= mb_test (pattern, cflags, string, eflags, expect, matches,


	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-21  0:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-21  0:28 [PATCH] Fix a thinko in tst-rxspencer Jakub Jelinek

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 read-only IMAP folder(s) and NNTP newsgroup(s).