diff options
author | TizenOpenSource <tizenopensrc@samsung.com> | 2022-12-27 12:15:44 +0900 |
---|---|---|
committer | TizenOpenSource <tizenopensrc@samsung.com> | 2022-12-27 12:15:44 +0900 |
commit | 63bb5dc37a2dfabc6c03c04bc27ea5d47b922863 (patch) | |
tree | 13e5ba9b31ae74cbb14da50aac84905018a7fba5 /gnulib-tests/test-memchr.c | |
parent | 8b3c9e355c111dccdc9116fbb27514acb21789f1 (diff) | |
download | diffutils-63bb5dc37a2dfabc6c03c04bc27ea5d47b922863.tar.gz diffutils-63bb5dc37a2dfabc6c03c04bc27ea5d47b922863.tar.bz2 diffutils-63bb5dc37a2dfabc6c03c04bc27ea5d47b922863.zip |
Imported Upstream version 3.8upstream/3.8
Diffstat (limited to 'gnulib-tests/test-memchr.c')
-rw-r--r-- | gnulib-tests/test-memchr.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gnulib-tests/test-memchr.c b/gnulib-tests/test-memchr.c index f191587..1357d08 100644 --- a/gnulib-tests/test-memchr.c +++ b/gnulib-tests/test-memchr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2018 Free Software Foundation, Inc. + * Copyright (C) 2008-2021 Free Software Foundation, Inc. * Written by Eric Blake and Bruno Haible * * This program is free software: you can redistribute it and/or modify @@ -49,7 +49,12 @@ main (void) ASSERT (MEMCHR (input, 'a', n) == input); ASSERT (MEMCHR (input, 'a', 0) == NULL); - ASSERT (MEMCHR (zerosize_ptr (), 'a', 0) == NULL); + + { + void *page_boundary = zerosize_ptr (); + if (page_boundary) + ASSERT (MEMCHR (page_boundary, 'a', 0) == NULL); + } ASSERT (MEMCHR (input, 'b', n) == input + 1); ASSERT (MEMCHR (input, 'c', n) == input + 2); @@ -88,7 +93,7 @@ main (void) /* Check that memchr() does not read past the first occurrence of the byte being searched. See the Austin Group's clarification - <http://www.opengroup.org/austin/docs/austin_454.txt>. + <https://www.opengroup.org/austin/docs/austin_454.txt>. Test both '\0' and something else, since some implementations special-case searching for NUL. */ |