From: Dmitry V. Levin Date: Tue, 17 May 2016 17:53:40 +0000 (+0000) Subject: umovestr3.test: extend test coverage X-Git-Tag: v4.12~117 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af09d4f4facede21f5832fc49630c3e899738acc;p=strace umovestr3.test: extend test coverage * tests/umovestr3.c: Include . (main): Test with each number between PATH_MAX-1 and 0. --- diff --git a/tests/umovestr3.c b/tests/umovestr3.c index c0a62cd9..7b2e6388 100644 --- a/tests/umovestr3.c +++ b/tests/umovestr3.c @@ -28,21 +28,22 @@ #include "tests.h" #include #include +#include int main(void) { (void) tail_alloc(1); - const unsigned int size = 8; - const char *const p = tail_alloc(size); + const unsigned int size = PATH_MAX - 1; + const char *p = tail_alloc(size); const char *const efault = p + size; (void) tail_alloc(1); + (void) tail_alloc(1); - int rc = chdir(p); - printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name()); - - rc = chdir(efault); - printf("chdir(%p) = %d %s (%m)\n", efault, rc, errno2name()); + for (; p <= efault; ++p) { + int rc = chdir(p); + printf("chdir(%p) = %d %s (%m)\n", p, rc, errno2name()); + } puts("+++ exited with 0 +++"); return 0;