From bdebeb77a001fc4d9ee8392829cd7bc6cd11d7d1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 1 Dec 2015 20:34:12 +0200 Subject: 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. --- modules/mod-test/test.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') 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"))) -- cgit v1.2.1