From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17158 invoked by alias); 13 Sep 2007 08:12:58 -0000 Received: (qmail 7842 invoked by uid 22791); 13 Sep 2007 08:03:34 -0000 X-Spam-Check-By: sourceware.org To: Tommy Nordgren Cc: Brian Gough , gsl-discuss@sourceware.org Subject: Re: test release gsl-1.9.90.tar.gz References: <87bqc9rmzg.fsf@hotbox.ru> <682A4679-3C95-4DE0-AC92-BF1B57A241B2@comhem.se> From: Aleksej Saushev Date: Thu, 13 Sep 2007 08:12:00 -0000 In-Reply-To: <682A4679-3C95-4DE0-AC92-BF1B57A241B2@comhem.se> (Tommy Nordgren's message of "Wed\, 12 Sep 2007 23\:01\:41 +0200") Message-ID: <87abrryotz.fsf@hotbox.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00030.txt.bz2 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.