public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Tommy Nordgren <tommy.nordgren@comhem.se>
To: Aleksej Saushev <asau@hotbox.ru>
Cc: Brian Gough <bjg@network-theory.co.uk>, gsl-discuss@sourceware.org
Subject: Re: test release gsl-1.9.90.tar.gz
Date: Thu, 13 Sep 2007 09:42:00 -0000	[thread overview]
Message-ID: <2DCC14D9-DF33-44C1-9244-D62994CBC5AA@comhem.se> (raw)
In-Reply-To: <87abrryotz.fsf@hotbox.ru>


On 13 sep 2007, at 10.03, Aleksej Saushev wrote:

> Tommy Nordgren <tommy.nordgren@comhem.se> writes:
>
>>> FAIL: gsl_isinf(-inf) (1 observed vs -1 expected) [112]
>>> FAIL: test
>
>> 	The following alternate patch will fix the test failure,
>> without  modifying the test cases.
>> --- /Users/emac/Desktop/infnan.c        2007-09-12
>> 22:37:19.000000000  +0200
>> +++ /Softsys/gsl-1.9.90/sys/infnan.c    2007-09-12
>> 22:44:30.000000000  +0200
>> @@ -118,7 +118,11 @@
>>  int
>>  gsl_isinf (const double x)
>>  {
>> -    return isinf(x);
>> +       int result = isinf(x);
>> +       if (result > 0 && x < 0) {
>> +               result = - result;
>> +       }
>> +       return result;
>>  }
>>  # else
>> Note: the one on the desktop is the unmodified file.
>> Also, with make -k check all other test cases pass.
>
> As for me, I don't like the proposal.
>
> It is clear, that the test case is wrong, since in C truth is
> denoted by "1", and not by "-1".  This is more convenient from
> scientist's point of view too.
>
> If you really want to fix test code, you'd better make it deal
> with standard semantic:
>
>    The isinf() macro returns a non-zero value if the value of x
>    is an infinity.  Otherwise 0 is returned.
>
> Obviously, test code doesn't behave well, when isinf returns
> 12345 as its value.
	It's still necessary to fix 'isfnan.c' somewhere though. There are  
two alternative
conditionally compiled versions of gsl_isinf.
	Here is an alternate fix, that will pass your updated test case,  
when isinf is not defined on the system.
--- /Users/emac/Desktop/infnan.c        2007-09-13 11:33:25.000000000  
+0200
+++ /Softsys/gsl-1.9.90/sys/infnan.c    2007-09-13 11:34:57.000000000  
+0200
@@ -127,7 +127,7 @@
  {
    if (! gsl_finite(x) && ! gsl_isnan(x))
      {
-      return (x > 0 ? +1 : -1);
+      return 1;
      }
    else
      {

------
What is a woman that you forsake her, and the hearth fire and the  
home acre,
to go with the old grey Widow Maker.  --Kipling, harp song of the  
Dane women
Tommy Nordgren
tommy.nordgren@comhem.se



  reply	other threads:[~2007-09-13  9:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-11  9:19 Brian Gough
2007-09-11 18:39 ` Patrick Alken
2007-09-12 17:04   ` Brian Gough
2007-09-13 13:45   ` Brian Gough
2007-09-13 16:30     ` Patrick Alken
2007-09-13 19:34       ` Brian Gough
2007-09-12  8:21 ` Aleksej Saushev
2007-09-12  8:48   ` Brian Gough
2007-09-12 20:12     ` Jari Häkkinen
2007-09-12 21:02   ` Tommy Nordgren
2007-09-12 21:03     ` Tommy Nordgren
2007-09-13  8:12     ` Aleksej Saushev
2007-09-13  9:42       ` Tommy Nordgren [this message]
2007-09-12 21:16 ` Oliver Jennrich
2007-09-13 12:42   ` Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2DCC14D9-DF33-44C1-9244-D62994CBC5AA@comhem.se \
    --to=tommy.nordgren@comhem.se \
    --cc=asau@hotbox.ru \
    --cc=bjg@network-theory.co.uk \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).