APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1528975073 -3600
#      Thu Jun 14 12:17:53 2018 +0100
# Node ID d3562c54da0c57eee6ec619b8f9f5e9a879510af
# Parent  86932fba11e0bd9fe72b16d197a0e28fd6d7f54a
Correct some test failures, lisp-tests.el
tests/ChangeLog addition:
2018-06-14  Aidan Kehoe  <kehoea(a)parhasard.net>
	* automated/lisp-tests.el:
	Be more careful about checking for a bug with the remainder in
	truncate on 64-bit builds.
	* automated/lisp-tests.el:
	#'move-to-column is now useful with a positive bignum, revise this
	check to reflect that.
	It now gives wrong-type-argument #'natnump instead of a range
	error when handed a negative bignum, assess for that too.
lisp/ChangeLog addition:
2018-06-14  Aidan Kehoe  <kehoea(a)parhasard.net>
	* test-harness.el (test-harness-from-buffer):
	Use the correct number of #'format arguments in calls to
	Print-Failure here, avoiding log chatter when XEmacs warns about
	too many arguments to #'format.
diff -r 86932fba11e0 -r d3562c54da0c lisp/ChangeLog
--- a/lisp/ChangeLog	Fri May 25 21:08:41 2018 +0100
+++ b/lisp/ChangeLog	Thu Jun 14 12:17:53 2018 +0100
@@ -1,3 +1,10 @@
+2018-06-14  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* test-harness.el (test-harness-from-buffer):
+	Use the correct number of #'format arguments in calls to
+	Print-Failure here, avoiding log chatter when XEmacs warns about
+	too many arguments to #'format.
+
 2018-05-25  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* events.el:
diff -r 86932fba11e0 -r d3562c54da0c lisp/test-harness.el
--- a/lisp/test-harness.el	Fri May 25 21:08:41 2018 +0100
+++ b/lisp/test-harness.el	Thu Jun 14 12:17:53 2018 +0100
@@ -423,19 +423,21 @@
 		#'(lambda (error-info)
 		    (if (eq 'cl-assertion-failed (car error-info))
 			(progn
-			  (Print-Failure
-			   (if ,failing-case
-			       "Assertion failed: %S; failing case = %S"
-			     "Assertion failed: %S")
-			   ,description ,failing-case)
+			  (Print-Failure 
+			   ,(if failing-case
+				"Assertion failed: %S; failing case = %S"
+			      "Assertion failed: %S")
+			   ,description
+			   ,@(if failing-case (list failing-case)))
 			  (incf assertion-failures)
 			  (test-harness-assertion-failure-do-debug error-info)
 			  nil)
 		      (Print-Failure
-		       (if ,failing-case
-			   "%S ==> error: %S; failing case =  %S"
-			 "%S ==> error: %S")
-		       ,description error-info ,failing-case)
+		       ,(if failing-case
+			    "%S ==> error: %S; failing case =  %S"
+			  "%S ==> error: %S")
+		       ,description error-info
+		       ,@(if failing-case (list failing-case)))
 		      (incf other-failures)
 		      (test-harness-unexpected-error-do-debug error-info)
 		      nil))
diff -r 86932fba11e0 -r d3562c54da0c tests/ChangeLog
--- a/tests/ChangeLog	Fri May 25 21:08:41 2018 +0100
+++ b/tests/ChangeLog	Thu Jun 14 12:17:53 2018 +0100
@@ -1,3 +1,14 @@
+2018-06-14  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* automated/lisp-tests.el:
+	Be more careful about checking for a bug with the remainder in
+	truncate on 64-bit builds.
+	* automated/lisp-tests.el:
+	#'move-to-column is now useful with a positive bignum, revise this
+	check to reflect that.
+	It now gives wrong-type-argument #'natnump instead of a range
+	error when handed a negative bignum, assess for that too.
+
 2018-04-27  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* automated/lisp-tests.el:
diff -r 86932fba11e0 -r d3562c54da0c tests/automated/lisp-tests.el
--- a/tests/automated/lisp-tests.el	Fri May 25 21:08:41 2018 +0100
+++ b/tests/automated/lisp-tests.el	Thu Jun 14 12:17:53 2018 +0100
@@ -2012,9 +2012,13 @@
   (when (featurep 'bignum)
     (assert (not (evenp most-positive-fixnum)) t
       "In the unlikely event that most-positive-fixnum is even, rewrite
this.")
-    (Assert (equal (multiple-value-list (truncate (+ most-positive-fixnum 2.0)))
-                   (list (+ most-positive-fixnum 2) 0.0))
-            "checking a bug in single-argument truncate's remainder
fixed")
+    (Assert (or (> most-positive-fixnum (expt 2.0 53))
+		(equal (multiple-value-list
+			   ;; This behaved badly if a float truncated to a
+			   ;; bignum.
+			   (truncate (+ most-positive-fixnum 2.0)))
+		       (list (+ most-positive-fixnum 2) 0.0)))
+	    "checking a bug in single-argument truncate's remainder fixed")
     (Assert-rounding (1+ most-positive-fixnum) (* 2 most-positive-fixnum)
       :one-floor-result `(,(1+ most-positive-fixnum) 0)
       :two-floor-result `(0 ,(1+ most-positive-fixnum))
@@ -2748,9 +2752,9 @@
      (set-face-background-pixmap
       'left-margin
       `[xbm :data (20 ,(* 2 most-positive-fixnum) "random-text")])))
-  (Check-Error args-out-of-range
-               (move-to-column (1+ most-positive-fixnum)))
-  (Check-Error args-out-of-range
+  (Assert (< (move-to-column (1+ most-positive-fixnum)) most-positive-fixnum)
+	  "checking #'move-to-column doesn't choke on a positive bignum")
+  (Check-Error wrong-type-argument
                (move-to-column (1- most-negative-fixnum)))
   (stop-profiling)
   (when (< most-positive-fixnum (lsh 1 32))
-- 
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)