On 16-Jun-2009, Rafael Laboissiere wrote:

| * Rafael Laboissiere <raf...@debian.org> [2009-06-15 21:55]:
| 
| > * John W. Eaton <j...@jweaton.org> [2009-06-15 13:25]:
| > 
| > > On 15-Jun-2009, Rafael Laboissiere wrote:
| > > 
| > > | Anyway, it is funny to see how long this bug lived in the code and was
| > > | just awakened by the crappy mips/mipsel architecture...
| > > 
| > > Also strange that it didn't show up until now, even on mips.  Maybe a
| > > compiler change?
| > 
| > Probably.
| > 
| > Anyway, these differences on floating point representation/manipulation
| > among the architectures make me kinda nervous.
| 
| I am wondering whether we could add a regression test like the following
| to data.cc (or wherever):
| 
| /*
| %!test
| %! format short
| %! for r = [0, Inf -Inf, NaN]
| %!     for i = [0, Inf -Inf, NaN]
| %!         complex (r, i)
| %!     endfor
| %! endfor
| */
| 
| Yes, the 'complex (r, i)' would lack the semicolon, just to exercise the
| code in pr-output.cc.

Are you sure you would want this?  It won't tell you if the printing
is correct without manual inspection, and will clutter the output from
running "make check" with

    src/pr-output.cc .......................................ans =  0 + 0i
  ans =    0 + Infi
  ans =    0 - Infi
  ans =    0 + NaNi
  ans = Inf +   0i
  ans = Inf + Infi
  ans = Inf - Infi
  ans = Inf + NaNi
  ans = -Inf +   0i
  ans = -Inf + Infi
  ans = -Inf - Infi
  ans = -Inf + NaNi
  ans = NaN +   0i
  ans = NaN + Infi
  ans = NaN - Infi
  ans = NaN + NaNi
   PASS    1/1   

Is there another way to test this without printing the output to the
sreen?  Maybe use fdisp to put the output in a file and then compare
the contents of the file to some expected value?

jwe



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to