about summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-02-17 07:08:51 +0000
committerUlrich Drepper <drepper@redhat.com>2004-02-17 07:08:51 +0000
commit71b1675eed1792430695bbd09e4882569c45e16a (patch)
tree8fe38b34aa07955cfa2d7ee201bdb08841fdf07d /stdlib
parent33d5279258825463ffd51d7b810340bb56f11083 (diff)
downloadglibc-71b1675eed1792430695bbd09e4882569c45e16a.tar.gz
glibc-71b1675eed1792430695bbd09e4882569c45e16a.tar.xz
glibc-71b1675eed1792430695bbd09e4882569c45e16a.zip
Update.
	* stdlib/test-canon.c (do_test): Test realpath(,NULL) in the loop
	as well.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/test-canon.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/stdlib/test-canon.c b/stdlib/test-canon.c
index 6b7375afd9..f070df74a0 100644
--- a/stdlib/test-canon.c
+++ b/stdlib/test-canon.c
@@ -1,5 +1,5 @@
 /* Test program for returning the canonical absolute name of a given file.
-   Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger <davidm@azstarnet.com>.
 
@@ -186,6 +186,17 @@ do_test (int argc, char ** argv)
 	  ++errors;
 	  continue;
 	}
+
+      char *result2 = realpath (tests[i].in, NULL);
+      if ((result2 == NULL && result != NULL)
+	  || (result2 != NULL && strcmp (result, result2) != 0))
+	{
+	  printf ("\
+%s: realpath(..., NULL) produced different result than realpath(..., buf): '%s' vs '%s'\n",
+		  argv[0], result2, result);
+	  ++errors;
+	}
+      free (result2);
     }
 
   getcwd (buf, sizeof(buf));