diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-12-01 20:34:12 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-12-01 20:34:12 +0200 |
commit | bdebeb77a001fc4d9ee8392829cd7bc6cd11d7d1 (patch) | |
tree | 250edf54b542db3477da7bfd4ae9fc2ba96c4ca7 /modules | |
parent | b99a34bcb030d59e0e272b3379d1725a6eb01d95 (diff) | |
download | emacs-bdebeb77a001fc4d9ee8392829cd7bc6cd11d7d1.tar.gz |
Fix emacs-module.c for wide ints
* src/emacs-module.c (lisp_to_value): Compare the produced value
with the original Lisp object, not with the one potentially
converted into a Lisp_Cons. Fixes assertion violations when
working with integers larger than fit into a 32-bit value.
* modules/mod-test/test.el (mod-test-sum-test): Add tests for
large integers, to test --with-wide-int.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mod-test/test.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/mod-test/test.el b/modules/mod-test/test.el index a0abdab49e5..eacc6671ead 100644 --- a/modules/mod-test/test.el +++ b/modules/mod-test/test.el @@ -42,7 +42,11 @@ (nth 1 descr)))) (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)) + (should-error (mod-test-sum 1 "2") :type 'wrong-type-argument) + (should (= (mod-test-sum -1 most-positive-fixnum) + (1- most-positive-fixnum))) + (should (= (mod-test-sum 1 most-negative-fixnum) + (1+ most-negative-fixnum)))) (ert-deftest mod-test-sum-docstring () (should (string= (documentation 'mod-test-sum) "Return A + B"))) |