]> git.eshelyaron.com Git - emacs.git/commitdiff
Port mod-test to x86-64 GNU/Linux running 32-bit
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2015 16:55:30 +0000 (08:55 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2015 17:09:58 +0000 (09:09 -0800)
* modules/mod-test/test.el (mod-test-sum-test):
Don’t attempt to match descriptions to operating systems.
It didn’t work on Fedora x86-64 running a 32-bit executable,
and it’s not worth the trouble anyway.
Port to 32-bit platforms by removing an assumption about
fixnum widths.

modules/mod-test/test.el

index ad4cc49c6909dc721c7e980fa747f667414f5d3e..c1defae9bd72442ecaa14ed5e84a414f17dc5b7a 100644 (file)
     (should (stringp (nth 1 descr)))
     (should (eq 0
                 (string-match
-                 (if (eq system-type 'windows-nt)
-                     "#<module function at \\(0x\\)?[0-9a-fA-F]+ from .*>"
-                   (if (eq system-type 'cygwin)
-                       "#<module function at \\(0x\\)?[0-9a-fA-F]+>"
-                     "#<module function Fmod_test_sum from .*>"))
+                 (concat "#<module function "
+                         "\\(at \\(0x\\)?[0-9a-fA-F]+\\( from .*\\)?"
+                         "\\|Fmod_test_sum from .*\\)>")
                  (nth 1 descr))))
     (should (= (nth 2 descr) 3)))
   (should-error (mod-test-sum "1" 2) :type 'wrong-type-argument)
              (1- most-positive-fixnum)))
   (should (= (mod-test-sum 1 most-negative-fixnum)
              (1+ most-negative-fixnum)))
-  (should (= (mod-test-sum 1 #x1fffffff)
-             (1+  #x1fffffff)))
-  (should (= (mod-test-sum -1 #x20000000)
-             #x1fffffff)))
+  (should-error (mod-test-sum 1 most-positive-fixnum)
+                :type 'overflow-error)
+  (should-error (mod-test-sum -1 most-negative-fixnum)
+                :type 'overflow-error))
 
 (ert-deftest mod-test-sum-docstring ()
   (should (string= (documentation 'mod-test-sum) "Return A + B")))