diff mbox

Add memchr tests for n == 0

Message ID 20170524154656.GA14807@lucon.org
State New, archived
Headers show

Commit Message

H.J. Lu May 24, 2017, 3:46 p.m. UTC
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(+)

Comments

Adhemerval Zanella May 25, 2017, 6:17 p.m. UTC | #1
On 24/05/2017 12:46, H.J. Lu wrote:
> 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);
> 

LGTM, thanks.
diff mbox

Patch

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);