[tor-commits] [tor/master] Fix test_pick_circid on 32-bit platforms

nickm at torproject.org nickm at torproject.org
Wed May 7 07:27:52 UTC 2014


commit 8a2e66b623f470f8adb9c342d8b18d207be7f361
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed May 7 03:27:49 2014 -0400

    Fix test_pick_circid on 32-bit platforms
---
 src/test/test_circuitlist.c |   20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c
index 63c2edd..7b7d415 100644
--- a/src/test/test_circuitlist.c
+++ b/src/test/test_circuitlist.c
@@ -279,26 +279,26 @@ test_pick_circid(void *arg)
   chan1->circ_id_type = CIRC_ID_TYPE_LOWER;
   for (i = 0; i < 50; ++i) {
     circid = get_unique_circ_id_by_chan(chan1);
-    tt_int_op(0, <, circid);
-    tt_int_op(circid, <, (1<<15));
+    tt_uint_op(0, <, circid);
+    tt_uint_op(circid, <, (1<<15));
   }
   chan1->circ_id_type = CIRC_ID_TYPE_HIGHER;
   for (i = 0; i < 50; ++i) {
     circid = get_unique_circ_id_by_chan(chan1);
-    tt_int_op((1<<15), <, circid);
-    tt_int_op(circid, <, (1<<16));
+    tt_uint_op((1<<15), <, circid);
+    tt_uint_op(circid, <, (1<<16));
   }
 
   chan2->circ_id_type = CIRC_ID_TYPE_LOWER;
   for (i = 0; i < 50; ++i) {
     circid = get_unique_circ_id_by_chan(chan2);
-    tt_int_op(0, <, circid);
-    tt_int_op(circid, <, (1u<<31));
+    tt_uint_op(0, <, circid);
+    tt_uint_op(circid, <, (1u<<31));
   }
   chan2->circ_id_type = CIRC_ID_TYPE_HIGHER;
   for (i = 0; i < 50; ++i) {
     circid = get_unique_circ_id_by_chan(chan2);
-    tt_int_op((1u<<31), <, circid);
+    tt_uint_op((1u<<31), <, circid);
   }
 
   /* Now make sure that we can behave well when we are full up on circuits */
@@ -312,7 +312,7 @@ test_pick_circid(void *arg)
       tt_int_op(i, >, (1<<14));
       break;
     }
-    tt_int_op(circid, <, (1<<15));
+    tt_uint_op(circid, <, (1<<15));
     tt_assert(! bitarray_is_set(ba, circid));
     bitarray_set(ba, circid);
     channel_mark_circid_unusable(chan1, circid);
@@ -321,8 +321,8 @@ test_pick_circid(void *arg)
   /* Make sure that being full on chan1 does not interfere with chan2 */
   for (i = 0; i < 100; ++i) {
     circid = get_unique_circ_id_by_chan(chan2);
-    tt_int_op(circid, >, 0);
-    tt_int_op(circid, <, (1<<15));
+    tt_uint_op(circid, >, 0);
+    tt_uint_op(circid, <, (1<<15));
     channel_mark_circid_unusable(chan2, circid);
   }
 



More information about the tor-commits mailing list