tests: fix compiler warnings
authorEric Blake <eblake@redhat.com>
Wed, 3 Nov 2010 22:48:56 +0000 (16:48 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 3 Nov 2010 22:52:51 +0000 (16:52 -0600)
Detected by icc.  The first three files are real test bugs, the
last merely silences a warning about mixing an int with an enum type.

* tests/test-getopt.h (test_getopt): Fix condition.
* tests/test-getopt_long.h (test_getopt_long): Likewise.
* tests/test-pipe2.c (main): Likewise.
* tests/test-quotearg-simple.c (main): Avoid icc warning.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
tests/test-getopt.h
tests/test-getopt_long.h
tests/test-pipe2.c
tests/test-quotearg-simple.c

index 73e19daa96643a69b898ec096649f8f7cde5484e..68c0a75846663a7dd09373a439a37c72b41d24a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-11-03  Eric Blake  <eblake@redhat.com>
 
+       tests: fix compiler warnings
+       * tests/test-getopt.h (test_getopt): Fix condition.
+       * tests/test-getopt_long.h (test_getopt_long): Likewise.
+       * tests/test-pipe2.c (main): Likewise.
+       * tests/test-quotearg-simple.c (main): Avoid icc warning.
+
        utimens: fix broken m4 test
        * m4/utimens.m4 (gl_UTIMENS): Include correct headers.
 
index 8baa39d0254bf924e4d04c1c19a92f23a09ff01e..12859ac9ece2835c0f0e70b6f7a24f6418a7063e 100644 (file)
@@ -1187,7 +1187,7 @@ test_getopt (void)
       ASSERT (q_value == NULL);
       ASSERT (non_options_count == 0);
       ASSERT (unrecognized == 0);
-      ASSERT (optind = 1);
+      ASSERT (optind == 1);
       ASSERT (!output);
     }
 #endif /* GNULIB_TEST_GETOPT_GNU */
index 0e58fecbb868bbe497add61ef1622dedb15b5e6a..e1bf732331ef77c274560d85783cf0fe02f134fb 100644 (file)
@@ -1747,7 +1747,7 @@ test_getopt_long (void)
       ASSERT (q_value == NULL);
       ASSERT (non_options_count == 0);
       ASSERT (unrecognized == 0);
-      ASSERT (optind = 1);
+      ASSERT (optind == 1);
     }
 
   /* Check that the '+' flag has to come first.  */
index e8e579897411bd79e3139995852f248d222c9b6f..a39de584a480ca11754569ad06acd3a900e9131d 100644 (file)
@@ -117,8 +117,8 @@ main ()
         ASSERT (fd[0] >= 0);
         ASSERT (fd[1] >= 0);
         ASSERT (fd[0] != fd[1]);
-        ASSERT (is_open (fd[0]) >= 0);
-        ASSERT (is_open (fd[1]) >= 0);
+        ASSERT (is_open (fd[0]));
+        ASSERT (is_open (fd[1]));
         if (use_cloexec)
           {
             ASSERT (is_cloexec (fd[0]));
index 095b199ae56aab83cd9de01b1f0147597a534101..bd637eec7b112ea9b80f450f506c8aef60a885dd 100644 (file)
@@ -244,7 +244,7 @@ main (int argc _GL_UNUSED, char *argv[])
   ASSERT (!isprint ('\033'));
   for (i = literal_quoting_style; i <= clocale_quoting_style; i++)
     {
-      set_quoting_style (NULL, i);
+      set_quoting_style (NULL, (enum quoting_style) i);
       compare_strings (use_quotearg_buffer, &results_g[i].group1, ascii_only);
       compare_strings (use_quotearg, &results_g[i].group2, ascii_only);
       if (i == c_quoting_style)