From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Ken Brown <kbrown@cornell.edu>
Newsgroups: gmane.emacs.devel
Subject: Re: [Emacs-diffs] master c48e539 2/2: Use the expression angle units
	while simplifying it
Date: Thu, 25 May 2017 17:42:05 -0400
Message-ID: <481777e0-5b91-6d6c-7fbe-645e197a1502@cornell.edu>
References: <20170518054755.876.89150@vcs0.savannah.gnu.org>
	<20170518054757.B498920AC9@vcs0.savannah.gnu.org>
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: blaine.gmane.org 1495748559 2717 195.159.176.226 (25 May 2017 21:42:39 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 25 May 2017 21:42:39 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
	Thunderbird/52.1.1
To: emacs-devel@gnu.org, Tino Calancha <tino.calancha@gmail.com>
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 25 23:42:35 2017
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([208.118.235.17])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1dE0Wg-0000aB-Vr
	for ged-emacs-devel@m.gmane.org; Thu, 25 May 2017 23:42:35 +0200
Original-Received: from localhost ([::1]:33825 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1dE0Wm-0007sI-Hw
	for ged-emacs-devel@m.gmane.org; Thu, 25 May 2017 17:42:40 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36048)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kbrown@cornell.edu>) id 1dE0WE-0007rX-Bj
	for emacs-devel@gnu.org; Thu, 25 May 2017 17:42:07 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kbrown@cornell.edu>) id 1dE0W9-0007K0-GZ
	for emacs-devel@gnu.org; Thu, 25 May 2017 17:42:06 -0400
Original-Received: from limerock03.mail.cornell.edu ([128.84.13.243]:37006)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kbrown@cornell.edu>) id 1dE0W9-0007JX-At
	for emacs-devel@gnu.org; Thu, 25 May 2017 17:42:01 -0400
X-CornellRouted: This message has been Routed already.
Original-Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu
	[10.16.197.8])
	by limerock03.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id
	v4PLfxFd028034; Thu, 25 May 2017 17:41:59 -0400
Original-Received: from [192.168.0.4] (mta-68-175-129-7.twcny.rr.com [68.175.129.7]
	(may be forged)) (authenticated bits=0)
	by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id
	v4PLfvvf003167
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);
	Thu, 25 May 2017 17:41:58 -0400
In-Reply-To: <20170518054757.B498920AC9@vcs0.savannah.gnu.org>
Content-Language: en-US
X-PMX-Cornell-Gauge: Gauge=XXXXX
X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none;
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 128.84.13.243
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-devel/>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=subscribe>
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Original-Sender: "Emacs-devel" <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Xref: news.gmane.org gmane.emacs.devel:215204
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/215204>

On 5/18/2017 1:47 AM, Tino Calancha wrote:
> --- a/test/lisp/calc/calc-tests.el
> +++ b/test/lisp/calc/calc-tests.el
> @@ -86,6 +86,50 @@ An existing calc stack is reused, otherwise a new one is created."
>   					       (math-read-expr "1m") "cm")
>   			    '(* -100 (var cm var-cm)))))
>   
> +(ert-deftest test-calc-23889 ()
> +  "Test forhttp://debbugs.gnu.org/23889  and 25652."
> +  (dolist (mode '(deg rad))
> +    (let ((calc-angle-mode mode))
> +      ;; If user inputs angle units, then should ignore `calc-angle-mode'.
> +      (should (string= "5253"
> +                       (substring
> +                        (number-to-string
> +                         (nth 1
> +                              (math-simplify-units
> +                               '(calcFunc-cos (* 45 (var rad var-rad))))))
> +                        0 4)))

This can fail on some platforms, depending on the size of a Lisp 
integer, because

(nth 1
      (math-simplify-units
       '(calcFunc-cos (* 45 (var rad var-rad)))))

doesn't necessarily evaluate to an integer.  For example, on 32-bit 
Cygwin it evaluates to (bigpos 8818 2198 5253).  This causes the test to 
fail as follows:

$ make -C test calc-tests SELECTOR='\"test-calc-23889$$\"'
[...]
Test test-calc-23889 condition:
     (wrong-type-argument numberp
                          (bigpos 8818 2198 5253))
    FAILED  1/1  test-calc-23889

Ken