2007-08-06 Simon Josefsson <simon@josefsson.org>
[gnulib.git] / tests / test-dirname.c
index 20279d2..eac9162 100644 (file)
@@ -1,5 +1,5 @@
 /* Test the gnulib dirname module.
-   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -15,9 +15,7 @@
    with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 #include "dirname.h"
 
@@ -26,8 +24,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "strdup.h"
-
 const char *program_name = "test-dirname";
 
 struct test {
@@ -156,8 +152,9 @@ main ()
                 || (dirlen + 1 == strlen (dir) && dir[dirlen] == '.'))))
        {
          ok = false;
-         printf ("dir_name `%s': got `%s' len %d, expected `%s' len %d\n",
-                 t->name, dir, dirlen, t->dir, strlen (t->dir));
+         printf ("dir_name `%s': got `%s' len %d, expected `%s' len %ld\n",
+                 t->name, dir, dirlen,
+                 t->dir, (unsigned long) strlen (t->dir));
        }
       if (strcmp (last, t->last))
        {
@@ -171,8 +168,9 @@ main ()
                     && ISSLASH (base[baselen])))))
        {
          ok = false;
-         printf ("base_name `%s': got `%s' len %d, expected `%s' len %d\n",
-                 t->name, base, baselen, t->base, strlen (t->base));
+         printf ("base_name `%s': got `%s' len %d, expected `%s' len %ld\n",
+                 t->name, base, baselen,
+                 t->base, (unsigned long) strlen (t->base));
        }
       if (strcmp (stripped, t->stripped) || modified != t->modified)
        {