summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-05-25 11:36:53 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-05-25 11:38:01 -0700
commitacf6d579e0ebb1644417b6a7894ebe6794ec7667 (patch)
treeae51e245f9ae7ceaa0a9eba73d4224981157bc25
parent6e75b0110d39be39131e9b458c256521df1eb657 (diff)
downloadglibc-acf6d579e0ebb1644417b6a7894ebe6794ec7667.tar.gz
Add memchr tests for n == 0
* string/test-memchr.c (test_main): Add tests for n == 0.
-rw-r--r--ChangeLog4
-rw-r--r--string/test-memchr.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index dd814acd4b..99efccf6a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-05-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ * string/test-memchr.c (test_main): Add tests for n == 0.
+
2017-05-25 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* nptl/Makefile (tests): Move nptl/tst-mutex8, nptl/tst-mutex8-static,
diff --git a/string/test-memchr.c b/string/test-memchr.c
index 669e092e7d..73a93f0fc9 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -179,6 +179,10 @@ test_main (void)
for (i = 1; i < 8; ++i)
{
+ /* Test n == 0. */
+ do_test (i, i, 0, 0, 23);
+ do_test (i, i, 0, 0, 0);
+
do_test (0, 16 << i, 2048, 2048, 23);
do_test (i, 64, 256, 256, 23);
do_test (0, 16 << i, 2048, 2048, 0);