From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16582 invoked by alias); 13 Sep 2007 09:42:10 -0000 Received: (qmail 16571 invoked by uid 22791); 13 Sep 2007 09:42:09 -0000 X-Spam-Check-By: sourceware.org Received: from ch-smtp02.sth.basefarm.net (HELO ch-smtp02.sth.basefarm.net) (80.76.149.213) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Sep 2007 09:42:00 +0000 Received: from c213-89-101-39.bredband.comhem.se ([213.89.101.39]:33069 helo=[192.168.0.2]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.66) (envelope-from ) id 1IVlCv-0005Nt-7H; Thu, 13 Sep 2007 11:41:57 +0200 In-Reply-To: <87abrryotz.fsf@hotbox.ru> References: <87bqc9rmzg.fsf@hotbox.ru> <682A4679-3C95-4DE0-AC92-BF1B57A241B2@comhem.se> <87abrryotz.fsf@hotbox.ru> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2DCC14D9-DF33-44C1-9244-D62994CBC5AA@comhem.se> Cc: Brian Gough , gsl-discuss@sourceware.org Content-Transfer-Encoding: 7bit From: Tommy Nordgren Subject: Re: test release gsl-1.9.90.tar.gz Date: Thu, 13 Sep 2007 09:42:00 -0000 To: Aleksej Saushev X-Mailer: Apple Mail (2.752.2) X-Scan-Result: No virus found in message 1IVlCv-0005Nt-7H. Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00031.txt.bz2 On 13 sep 2007, at 10.03, Aleksej Saushev wrote: > Tommy Nordgren 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