This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: test release gsl-1.9.90.tar.gz
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.