summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-21 07:20:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-21 07:20:31 -0700
commita63cdae8efd80d1130f54cac8a7d2767a0d87342 (patch)
tree3e4187eeec72424cc62d6c9ee6f21b1bfa4ab363
parent216c5e7b71317b04731f9a0acd8451dc106d86c0 (diff)
downloadtxr-a63cdae8efd80d1130f54cac8a7d2767a0d87342.tar.gz
txr-a63cdae8efd80d1130f54cac8a7d2767a0d87342.tar.bz2
txr-a63cdae8efd80d1130f54cac8a7d2767a0d87342.zip
match: binary-integer conv tests for #x-8000...
* tests/016/arith.tl: Test providing coverage for the most negative two's complement integer, #x-800...00 in various sizes. The 64 bit cases are failing.
-rw-r--r--tests/016/arith.tl21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/016/arith.tl b/tests/016/arith.tl
index 1609833f..43efb6bb 100644
--- a/tests/016/arith.tl
+++ b/tests/016/arith.tl
@@ -121,3 +121,24 @@
#xAABBCCDDEE)
(test (ffi-get #b'000000AABBCCDDEE' (ffi be-int64))
#xAABBCCDDEE)
+
+(test (mequal (ffi-put #x-8000 (ffi int16))
+ #b'0080'
+ #b'8000') t)
+
+(test (ffi-get (ffi-put #x-8000 (ffi int16)) (ffi int16))
+ #x-8000)
+
+(test (mequal (ffi-put #x-80000000 (ffi int32))
+ #b'00000080'
+ #b'80000000') t)
+
+(test (ffi-get (ffi-put #x-80000000 (ffi int32)) (ffi int32))
+ #x-80000000)
+
+(test (mequal (ffi-put #x-8000000000000000 (ffi int64))
+ #b'0000000000000080'
+ #b'8000000000000000') t)
+
+(test (ffi-get (ffi-put #x-8000000000000000 (ffi int64)) (ffi int64))
+ #x-8000000000000000)