This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add memchr tests for n == 0
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 24 May 2017 08:46:56 -0700
- Subject: [PATCH] Add memchr tests for n == 0
- Authentication-results: sourceware.org; auth=none
Any comments?
H.J.
* string/test-memchr.c (test_main): Add tests for n == 0.
---
string/test-memchr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/string/test-memchr.c b/string/test-memchr.c
index 669e092..73a93f0 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);
--
2.9.4