From b3da6aaad047268e13cd3c81c5d03ee0edcea867 Mon Sep 17 00:00:00 2001 From: drepper Date: Wed, 5 Nov 1997 23:52:21 +0000 Subject: [PATCH] Test "" and NULL argument handling. --- stdlib/test-canon.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c index ffd6fa99d4..c239d50ae8 100644 --- a/stdlib/test-canon.c +++ b/stdlib/test-canon.c @@ -117,6 +117,30 @@ main (int argc, char ** argv) getcwd (cwd, sizeof(buf)); cwd_len = strlen (cwd); + errno = 0; + if (realpath (NULL, buf) != NULL || errno != EINVAL) + { + printf ("%s: expected return value NULL and errno set to EINVAL" + " for realpath(NULL,...)\n", argv[0]); + ++errors; + } + + errno = 0; + if (realpath ("/", NULL) != NULL || errno != EINVAL) + { + printf ("%s: expected return value NULL and errno set to EINVAL" + " for realpath(...,NULL)\n", argv[0]); + ++errors; + } + + errno = 0; + if (realpath ("", buf) != NULL || errno != ENOENT) + { + printf ("%s: expected return value NULL and set errno to ENOENT", + " for realpath(\"\",...)\n", argv[0]); + ++errors; + } + for (i = 0; i < (int) (sizeof (symlinks) / sizeof (symlinks[0])); ++i) symlink (symlinks[i].value, symlinks[i].name); -- 2.11.0