summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-12-02 16:06:01 +0200
committerEli Zaretskii <eliz@gnu.org>2015-12-02 16:06:01 +0200
commit36dbe6fc3e141e5b4c87efec5026931b89f026a5 (patch)
tree799aeb97c74682607b3dd6ad853b26e50e2b745b /modules
parent0af2c269b1d68d114e74aa1313b2ad7d1fe21726 (diff)
downloademacs-36dbe6fc3e141e5b4c87efec5026931b89f026a5.tar.gz
More emacs-module.c fixes for wide ints
* src/emacs-module.c (value_to_lisp) [WIDE_EMACS_INT]: Use unsigned data types to manipulate pointers, to avoid sign extension coming after us with a vengeance. * modules/mod-test/test.el (mod-test-sum-test): Add tests for Emacs with wide ints that verify integer values near the critical value that requires us to switch to a cons cell.
Diffstat (limited to 'modules')
-rw-r--r--modules/mod-test/test.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/mod-test/test.el b/modules/mod-test/test.el
index eacc6671ead..ad4cc49c690 100644
--- a/modules/mod-test/test.el
+++ b/modules/mod-test/test.el
@@ -43,10 +43,15 @@
(should (= (nth 2 descr) 3)))
(should-error (mod-test-sum "1" 2) :type 'wrong-type-argument)
(should-error (mod-test-sum 1 "2") :type 'wrong-type-argument)
+ ;; The following tests are for 32-bit build --with-wide-int.
(should (= (mod-test-sum -1 most-positive-fixnum)
(1- most-positive-fixnum)))
(should (= (mod-test-sum 1 most-negative-fixnum)
- (1+ most-negative-fixnum))))
+ (1+ most-negative-fixnum)))
+ (should (= (mod-test-sum 1 #x1fffffff)
+ (1+ #x1fffffff)))
+ (should (= (mod-test-sum -1 #x20000000)
+ #x1fffffff)))
(ert-deftest mod-test-sum-docstring ()
(should (string= (documentation 'mod-test-sum) "Return A + B")))