This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-440-gd7e0dab


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  d7e0dab96d1a855f7ff779195010c188c334669e (commit)
       via  03759f47db62930f2dddf1c9733ef89b9d99e2da (commit)
      from  fb228a2d94a130eda38c8794b0f264aa9f0e4714 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d7e0dab96d1a855f7ff779195010c188c334669e

commit d7e0dab96d1a855f7ff779195010c188c334669e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Oct 5 13:30:02 2012 -0700

    Add a testase for BZ #14602

diff --git a/ChangeLog b/ChangeLog
index 63c9ce8..916b851 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-10-05  H.J. Lu  <hongjiu.lu@intel.com>
 
+	[BZ #14602]
+	* string/test-strstr.c (check2): New function.
+	(test_main): Call check2.
+
 	* string/Makefile (tests): Remove bug-strstr1, bug-strcasestr1
 	and bug-strchr1.
 	* string/bug-strcasestr1.c (do_test): Moved to ...
diff --git a/string/test-strstr.c b/string/test-strstr.c
index e7d8e73..1aebd35 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -156,12 +156,24 @@ check1 (void)
     check_result (impl, s1, s2, exp_result);
 }
 
+static void
+check2 (void)
+{
+  const char s1[] = ", enable_static, \0, enable_shared, ";
+  char *exp_result;
+
+  exp_result = stupid_strstr (s1, s1 + 18);
+  FOR_EACH_IMPL (impl, 0)
+    check_result (impl, s1, s1 + 18, exp_result);
+}
+
 static int
 test_main (void)
 {
   test_init ();
 
   check1 ();
+  check2 ();
 
   printf ("%23s", "");
   FOR_EACH_IMPL (impl, 0)

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=03759f47db62930f2dddf1c9733ef89b9d99e2da

commit 03759f47db62930f2dddf1c9733ef89b9d99e2da
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Oct 5 13:32:07 2012 -0700

    Test strcasestr/strchr/strstr under all implementations

diff --git a/ChangeLog b/ChangeLog
index 4ecb9d5..63c9ce8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,29 @@
 2012-10-05  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* string/Makefile (tests): Remove bug-strstr1, bug-strcasestr1
+	and bug-strchr1.
+	* string/bug-strcasestr1.c (do_test): Moved to ...
+	* string/test-strcasestr.c (check1): Here.  New function.
+	(do_one_test): Break out result checking code into ...
+	(check_result): This.  New function.
+	(do_one_test): Call check_result.
+	(test_main): Call check1.
+	* string/bug-strchr1.c (do_test): Moved to ...
+	* string/test-strchr.c (check1): Here.  New function.
+	(do_one_test): Break out result checking code into ...
+	(check_result): This.  New function.
+	(do_one_test): Call check_result.
+	(test_main): Call check1.
+	* string/bug-strstr1.c (main): Moved to ...
+	* string/test-strchr.c (check1): Here.  New function.
+	(do_one_test): Break out result checking code into ...
+	(check_result): This.  New function.
+	(do_one_test): Call check_result.
+	(test_main): Call check1.
+	* string/bug-strcasestr1.c: Removed.
+	* string/bug-strchr1.c: Likewise.
+	* string/bug-strstr1.c: Likewise.
+
 	* elf/Makefile (dl-routines): Add hwcaps.
 	* elf/dl-support.c (_dl_important_hwcaps): Removed.
 	* elf/dl-sysdep.c (_DL_FIRST_EXTRA): Likewise.
diff --git a/string/Makefile b/string/Makefile
index a1204d9..6f2c6c3 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -56,7 +56,7 @@ tests		:= tester inl-tester noinl-tester testcopy test-ffs	\
 		   tst-strtok tst-strxfrm bug-strcoll1 tst-strfry	\
 		   bug-strtok1 $(addprefix test-,$(strop-tests))	\
 		   bug-envz1 tst-strxfrm2 tst-endian tst-svc2		\
-		   bug-strstr1 bug-strcasestr1 bug-strchr1 tst-strtok_r
+		   tst-strtok_r
 
 
 include ../Rules
diff --git a/string/bug-strcasestr1.c b/string/bug-strcasestr1.c
deleted file mode 100644
index e8334d7..0000000
--- a/string/bug-strcasestr1.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Test for non-submitted strcasestr bug.
-   Copyright (C) 2012 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <stdio.h>
-#include <string.h>
-
-#define TEST_FUNCTION do_test ()
-static int
-do_test (void)
-{
-  const char haystack[] = "AOKB";
-  const char needle[] = "OK";
-  const char *sub = strcasestr (haystack, needle);
-
-  if (sub == NULL)
-    {
-      fprintf (stderr, "BUG: didn't find \"%s\" in \"%s\"\n", needle, haystack);
-      return 1;
-    }
-
-  return 0;
-}
-
-#include "../test-skeleton.c"
diff --git a/string/bug-strchr1.c b/string/bug-strchr1.c
deleted file mode 100644
index 21155d8..0000000
--- a/string/bug-strchr1.c
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-
-static int
-do_test (void)
-{
-  char s[] __attribute__((aligned(16))) = "\xff";
-  char *p = strchr (s, '\xfe');
-  printf ("%p\n", p);
-  return p != NULL;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/string/bug-strstr1.c b/string/bug-strstr1.c
deleted file mode 100644
index 889de12..0000000
--- a/string/bug-strstr1.c
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-
-int main (int argc, char** argv)
-{
-  const char haystack[] =
-    "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
-
-  const char needle[] =
-    "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
-
-  const char* sub = strstr (haystack, needle);
-
-  if (sub != NULL)
-    {
-      int j;
-
-      fprintf (stderr, "BUG: expected NULL, got:\n%s\n%s\n", sub, needle);
-      for (j = 0; needle[j] != '\0'; ++j)
-        putchar (needle[j] == sub[j] ? ' ' : '^');
-      puts ("");
-      return 1;
-    }
-
-  return 0;
-}
diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c
index 6c1a878..fc01858 100644
--- a/string/test-strcasestr.c
+++ b/string/test-strcasestr.c
@@ -57,8 +57,9 @@ IMPL (simple_strcasestr, 0)
 IMPL (strcasestr, 1)
 
 
-static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
+static int
+check_result (impl_t *impl, const char *s1, const char *s2,
+	      char *exp_result)
 {
   char *result = CALL (impl, s1, s2);
   if (result != exp_result)
@@ -66,8 +67,16 @@ do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
       error (0, 0, "Wrong result in function %s %s %s", impl->name,
 	     result, exp_result);
       ret = 1;
-      return;
+      return -1;
     }
+  return 0;
+}
+
+static void
+do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
+{
+  if (check_result (impl, s1, s2, exp_result) < 0)
+    return;
 
   if (HP_TIMING_AVAIL)
     {
@@ -136,12 +145,25 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
     putchar ('\n');
 }
 
+static void
+check1 (void)
+{
+  const char s1[] = "AOKB";
+  const char s2[] = "OK";
+  char *exp_result;
+
+  exp_result = stupid_strcasestr (s1, s2);
+  FOR_EACH_IMPL (impl, 0)
+    check_result (impl, s1, s2, exp_result);
+}
 
 static int
 test_main (void)
 {
   test_init ();
 
+  check1 ();
+
   printf ("%23s", "");
   FOR_EACH_IMPL (impl, 0)
     printf ("\t%s", impl->name);
diff --git a/string/test-strchr.c b/string/test-strchr.c
index e544aa7..161ac45 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -79,8 +79,8 @@ IMPL (stupid_STRCHR, 0)
 IMPL (simple_STRCHR, 0)
 IMPL (STRCHR, 1)
 
-static void
-do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
+static int
+check_result (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
 {
   CHAR *res = CALL (impl, s, c);
   if (res != exp_res)
@@ -88,8 +88,16 @@ do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
       error (0, 0, "Wrong result in function %s %#x %p %p", impl->name,
 	     c, res, exp_res);
       ret = 1;
-      return;
+      return -1;
     }
+  return 0;
+}
+
+static void
+do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
+{
+  if (check_result (impl, s, c, exp_res) < 0)
+    return;
 
   if (HP_TIMING_AVAIL)
     {
@@ -224,6 +232,17 @@ do_random_tests (void)
     }
 }
 
+static void
+check1 (void)
+{
+  char s[] __attribute__((aligned(16))) = "\xff";
+  char c = '\xfe';
+  char *exp_result = stupid_STRCHR (s, c);
+
+  FOR_EACH_IMPL (impl, 0)
+    check_result (impl, s, c, exp_result);
+}
+
 int
 test_main (void)
 {
@@ -231,6 +250,8 @@ test_main (void)
 
   test_init ();
 
+  check1 ();
+
   printf ("%20s", "");
   FOR_EACH_IMPL (impl, 0)
     printf ("\t%s", impl->name);
diff --git a/string/test-strstr.c b/string/test-strstr.c
index 6be4601..e7d8e73 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -55,8 +55,9 @@ IMPL (simple_strstr, 0)
 IMPL (strstr, 1)
 
 
-static void
-do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
+static int
+check_result (impl_t *impl, const char *s1, const char *s2,
+	      char *exp_result)
 {
   char *result = CALL (impl, s1, s2);
   if (result != exp_result)
@@ -64,9 +65,18 @@ do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
       error (0, 0, "Wrong result in function %s %s %s", impl->name,
 	     result, exp_result);
       ret = 1;
-      return;
+      return -1;
     }
 
+  return 0;
+}
+
+static void
+do_one_test (impl_t *impl, const char *s1, const char *s2, char *exp_result)
+{
+  if (check_result (impl, s1, s2, exp_result) < 0)
+    return;
+
   if (HP_TIMING_AVAIL)
     {
       hp_timing_t start __attribute ((unused));
@@ -133,12 +143,26 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
     putchar ('\n');
 }
 
+static void
+check1 (void)
+{
+  const char s1[] =
+    "F_BD_CE_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_88_20_EF_BF_BD_EF_BF_BD_EF_BF_BD_C3_A7_20_EF_BF_BD";
+  const char s2[] = "_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD_EF_BF_BD";
+  char *exp_result;
+
+  exp_result = stupid_strstr (s1, s2);
+  FOR_EACH_IMPL (impl, 0)
+    check_result (impl, s1, s2, exp_result);
+}
 
 static int
 test_main (void)
 {
   test_init ();
 
+  check1 ();
+
   printf ("%23s", "");
   FOR_EACH_IMPL (impl, 0)
     printf ("\t%s", impl->name);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |   28 ++++++++++++++++++++++++++++
 string/Makefile          |    2 +-
 string/bug-strcasestr1.c |   39 ---------------------------------------
 string/bug-strchr1.c     |   14 --------------
 string/bug-strstr1.c     |   26 --------------------------
 string/test-strcasestr.c |   28 +++++++++++++++++++++++++---
 string/test-strchr.c     |   27 ++++++++++++++++++++++++---
 string/test-strstr.c     |   42 +++++++++++++++++++++++++++++++++++++++---
 8 files changed, 117 insertions(+), 89 deletions(-)
 delete mode 100644 string/bug-strcasestr1.c
 delete mode 100644 string/bug-strchr1.c
 delete mode 100644 string/bug-strstr1.c


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]