diff options
Diffstat (limited to 'stdlib/test-canon.c')
-rw-r--r-- | stdlib/test-canon.c | 24 |
1 files changed, 24 insertions, 0 deletions
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); |