unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Module tests
@ 2015-12-06 17:53 Eli Zaretskii
  2015-12-06 22:56 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2015-12-06 17:53 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Commit 2b3f5de2b3 removed these 2 tests:

  (should (= (mod-test-sum 1 #x1fffffff)
             (1+  #x1fffffff)))
  (should (= (mod-test-sum -1 #x20000000)
             #x1fffffff))

They were written to test the code in emacs-module.c which switches
from scalar values to cons cells when the integer value is too large
for 32 bits and Emacs is compiled with wide ints.

I don't understand why the removal.  AFAICS, we still switch from
integers to cons cells, so the borderline values just above and below
the threshold are where be dragons, and we should keep them (they
helped me to find and fix a couple of bugs in the previous
implementation).  What am I missing?



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Module tests
  2015-12-06 17:53 Module tests Eli Zaretskii
@ 2015-12-06 22:56 ` Paul Eggert
  2015-12-07  3:38   ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2015-12-06 22:56 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Eli Zaretskii wrote:

> I don't understand why the removal.

Those tests failed on 32-bit Emacs configured --without-wide-int, as 1+ silently 
wraps around whereas mod-test-sum signals an integer overflow. Plus, on a 
32-bit-only Emacs #x20000000 evaluates to a floating-point number -- a flaw in 
Emacs, but is probably not something we can fix during a feature freeze.

Sorry, I hadn't realized the points of those tests, and thought my replacements 
were testing the same thing. I just now brought those tests back and ported them 
to 32-bit-only Emacs.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Module tests
  2015-12-06 22:56 ` Paul Eggert
@ 2015-12-07  3:38   ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2015-12-07  3:38 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

> Cc: emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Sun, 6 Dec 2015 14:56:11 -0800
> 
> Eli Zaretskii wrote:
> 
> > I don't understand why the removal.
> 
> Those tests failed on 32-bit Emacs configured --without-wide-int, as 1+ silently 
> wraps around whereas mod-test-sum signals an integer overflow. Plus, on a 
> 32-bit-only Emacs #x20000000 evaluates to a floating-point number -- a flaw in 
> Emacs, but is probably not something we can fix during a feature freeze.
> 
> Sorry, I hadn't realized the points of those tests, and thought my replacements 
> were testing the same thing. I just now brought those tests back and ported them 
> to 32-bit-only Emacs.

Thanks!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-12-07  3:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-06 17:53 Module tests Eli Zaretskii
2015-12-06 22:56 ` Paul Eggert
2015-12-07  3:38   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).