subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i...@apache.org
Subject svn commit: r1705972 - /subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c
Date Wed, 30 Sep 2015 07:07:26 GMT
Author: ivan
Date: Wed Sep 30 07:07:25 2015
New Revision: 1705972

URL: http://svn.apache.org/viewvc?rev=1705972&view=rev
Log:
Resolve signed/unsigned mismatch compilation warnings in bit-array-test.

* subversion/tests/libsvn_subr/bit-array-test.c
  (test_get_set, test_sparse): Use explicit test condition instead of
   comparing to 'i % 2' and '1-(i % 2)'.

Modified:
    subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c?rev=1705972&r1=1705971&r2=1705972&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/bit-array-test.c Wed Sep 30 07:07:25 2015
@@ -71,7 +71,12 @@ test_get_set(apr_pool_t *pool)
 
   /* Verify pattern */
   for (i = min; i < max; ++i)
-    SVN_TEST_ASSERT(svn_bit_array__get(array, i) == i % 2);
+    {
+      if (i % 2)
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == TRUE);
+      else
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == FALSE);
+    }
 
   /* Zero the zeros in the pattern -> should be no change. */
   for (i = min; i < max; ++i)
@@ -80,18 +85,36 @@ test_get_set(apr_pool_t *pool)
 
   /* Verify pattern */
   for (i = min; i < max; ++i)
-    SVN_TEST_ASSERT(svn_bit_array__get(array, i) == i % 2);
+    {
+      if (i % 2)
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == TRUE);
+      else
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == FALSE);
+    }
 
   /* Write an inverted pattern while verifying the old one. */
   for (i = min; i < max; ++i)
     {
-      SVN_TEST_ASSERT(svn_bit_array__get(array, i) == i % 2);
-      svn_bit_array__set(array, i, 1 - (i % 2));
+      if (i % 2)
+        {
+          SVN_TEST_ASSERT(svn_bit_array__get(array, i) == TRUE);
+          svn_bit_array__set(array, i, FALSE);
+        }
+      else
+        {
+          SVN_TEST_ASSERT(svn_bit_array__get(array, i) == FALSE);
+          svn_bit_array__set(array, i, TRUE);
+        }
     }
 
   /* Verify pattern */
   for (i = min; i < max; ++i)
-    SVN_TEST_ASSERT(svn_bit_array__get(array, i) == 1 - (i % 2));
+    {
+      if (i % 2)
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == FALSE);
+      else
+        SVN_TEST_ASSERT(svn_bit_array__get(array, i) == TRUE);
+    }
 
   return SVN_NO_ERROR;
 }
@@ -116,7 +139,12 @@ test_sparse(apr_pool_t *pool)
   /* Verify pattern */
   for (i = 0; i < 15; ++i)
     for (k = i * SCALE + min; k < i * SCALE +  max; ++k)
-      SVN_TEST_ASSERT(svn_bit_array__get(array, k) == k % 2);
+      {
+        if (k % 2)
+          SVN_TEST_ASSERT(svn_bit_array__get(array, k) == TRUE);
+        else
+          SVN_TEST_ASSERT(svn_bit_array__get(array, k) == FALSE);
+      }
 
   return SVN_NO_ERROR;
 }



Mime
View raw message