aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_ptr_slow.c
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2019-03-20 19:06:40 +0200
committerrl1987 <rl1987@sdf.lonestar.org>2019-03-20 19:06:40 +0200
commit72e0dc0822deb8587b3cae2edf584ece13cb6bb8 (patch)
treeb1eda1fd403595bfffff8ade98d112bfc5b7a1b4 /src/test/test_ptr_slow.c
parent280109473fe30d1e67f8db09ce279cc1f714a682 (diff)
downloadtor-72e0dc0822deb8587b3cae2edf584ece13cb6bb8.tar.gz
tor-72e0dc0822deb8587b3cae2edf584ece13cb6bb8.zip
Check roundtrip for each bit of {unsigned} int values
Diffstat (limited to 'src/test/test_ptr_slow.c')
-rw-r--r--src/test/test_ptr_slow.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test_ptr_slow.c b/src/test/test_ptr_slow.c
index 5b366b7d38..0142fd1c8a 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[] = {