[tor-commits] [tor/master] Check roundtrip for each bit of {unsigned} int values

teor at torproject.org teor at torproject.org
Tue Mar 26 09:31:42 UTC 2019


commit 72e0dc0822deb8587b3cae2edf584ece13cb6bb8
Author: rl1987 <rl1987 at sdf.lonestar.org>
Date:   Wed Mar 20 19:06:40 2019 +0200

    Check roundtrip for each bit of {unsigned} int values
---
 src/test/test_ptr_slow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/test/test_ptr_slow.c b/src/test/test_ptr_slow.c
index 5b366b7d3..0142fd1c8 100644
--- a/src/test/test_ptr_slow.c
+++ b/src/test/test_ptr_slow.c
@@ -44,6 +44,12 @@ test_int_voidstar_interop(void *arg)
   for (a = INT_MAX-1024; a < INT_MAX; a++) {
     assert_int_voidptr_roundtrip(a);
   }
+
+  a = 1;
+  for (unsigned long i = 0; i < sizeof(int) * 8; i++) {
+    assert_int_voidptr_roundtrip(a);
+    a = (a << 1);
+  }
 }
 
 static void
@@ -74,6 +80,12 @@ test_uint_voidstar_interop(void *arg)
   for (a = UINT_MAX-1024; a < UINT_MAX; a++) {
     assert_uint_voidptr_roundtrip(a);
   }
+
+  a = 1;
+  for (unsigned long i = 0; i < sizeof(int) * 8; i++) {
+    assert_uint_voidptr_roundtrip(a);
+    a = (a << 1);
+  }
 }
 
 struct testcase_t slow_ptr_tests[] = {





More information about the tor-commits mailing list