summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-03-17 19:22:56 +0000
committerBruno Haible <bruno@clisp.org>2007-03-17 19:22:56 +0000
commit4f87874de0991adc35c4777dbc3542677ca8dec9 (patch)
treedc0b0f72dd310656fb74529093bcf3da53895b75 /tests
parentffa98ad3d1508068dd38125c6d923882b01f63be (diff)
downloadgnulib-4f87874de0991adc35c4777dbc3542677ca8dec9.tar.gz
Avoid gcc warnings.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-crc.c10
-rw-r--r--tests/test-dirname.c10
-rw-r--r--tests/test-gc-pbkdf2-sha1.c7
-rw-r--r--tests/test-getaddrinfo.c4
-rw-r--r--tests/test-read-file.c6
5 files changed, 20 insertions, 17 deletions
diff --git a/tests/test-crc.c b/tests/test-crc.c
index 55b5046adb..72bb25db10 100644
--- a/tests/test-crc.c
+++ b/tests/test-crc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005, 2006 Free Software Foundation
+ * Copyright (C) 2005, 2006, 2007 Free Software Foundation
*
* 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
@@ -34,28 +34,28 @@ main (int argc, char *argv[])
p = crc32_update_no_xor (42, "foo", 3);
if (p != 0x46e87f05)
{
- printf ("cunx got %lx\n", p);
+ printf ("cunx got %lx\n", (unsigned long) p);
return 1;
}
p = crc32_no_xor ("foo", 3);
if (p != 0x7332bc33)
{
- printf ("cnx got %lx\n", p);
+ printf ("cnx got %lx\n", (unsigned long) p);
return 1;
}
p = crc32_update (42, "foo", 3);
if (p != 0xb9a9a617)
{
- printf ("cu got %lx\n", p);
+ printf ("cu got %lx\n", (unsigned long) p);
return 1;
}
p = crc32 ("foo", 3);
if (p != 0x8c736521)
{
- printf ("c got %lx\n", p);
+ printf ("c got %lx\n", (unsigned long) p);
return 1;
}
diff --git a/tests/test-dirname.c b/tests/test-dirname.c
index eace24e87e..4114b77024 100644
--- a/tests/test-dirname.c
+++ b/tests/test-dirname.c
@@ -154,8 +154,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))
{
@@ -169,8 +170,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)
{
diff --git a/tests/test-gc-pbkdf2-sha1.c b/tests/test-gc-pbkdf2-sha1.c
index 8027b9cb3e..d4f9dc86a7 100644
--- a/tests/test-gc-pbkdf2-sha1.c
+++ b/tests/test-gc-pbkdf2-sha1.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation
+ * Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation
*
* 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
@@ -95,13 +95,14 @@ main (int argc, char *argv[])
pkcs5[i].iterations, out, pkcs5[i].dklen);
if (rc != GC_OK)
{
- printf ("PKCS5 entry %d failed fatally: %d\n", i, rc);
+ printf ("PKCS5 entry %ld failed fatally: %d\n",
+ (unsigned long) i, rc);
return 1;
}
if (memcmp (pkcs5[i].expected, out, pkcs5[i].dklen) != 0)
{
- printf ("PKCS5 entry %d failed\n", i);
+ printf ("PKCS5 entry %ld failed\n", (unsigned long) i);
return 1;
}
}
diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
index 9f42fff2b5..c18c4b9244 100644
--- a/tests/test-getaddrinfo.c
+++ b/tests/test-getaddrinfo.c
@@ -1,6 +1,6 @@
/* Test the getaddrinfo module.
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 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
@@ -50,7 +50,7 @@ int simple (char *host, char *service)
printf ("\tfamily %x\n", ai->ai_family);
printf ("\tsocktype %x\n", ai->ai_socktype);
printf ("\tprotocol %x\n", ai->ai_protocol);
- printf ("\taddrlen %d: ", ai->ai_addrlen);
+ printf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
printf ("\tFound %s\n",
inet_ntop (ai->ai_family,
&((struct sockaddr_in *)
diff --git a/tests/test-read-file.c b/tests/test-read-file.c
index 635c4cbd97..d163b60280 100644
--- a/tests/test-read-file.c
+++ b/tests/test-read-file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Free Software Foundation
+ * Copyright (C) 2006-2007 Free Software Foundation
* Written by Simon Josefsson
*
* This program is free software; you can redistribute it and/or modify
@@ -42,7 +42,7 @@ main (void)
if (out[len] != '\0')
perror ("BAD: out[len] not zero");
- printf ("Read %d from %s...\n", len, FILE1);
+ printf ("Read %ld from %s...\n", (unsigned long) len, FILE1);
free (out);
}
@@ -57,7 +57,7 @@ main (void)
if (out[len] != '\0')
perror ("BAD: out[len] not zero");
- printf ("Read %d from %s...\n", len, FILE2);
+ printf ("Read %ld from %s...\n", (unsigned long) len, FILE2);
free (out);
}