|
|
sybperl-l Archive
Up Prev Next
From: "Srinivasan, Ravikumar" <ravikumar dot srinivasan at gs dot com>
Subject: RE: DBD::Sybase 1.07 install on Solaris 8 - failing t/exec.t test
#11
Date: Nov 2 2005 10:16PM
#!/usr/local/bin/perl
$x=5.40000000000000035527136788005009;
if ($x==5.40000000000000035527136788005009)
{
print "same\n";
}
else
{
print "not the same\n";
}
bash-2.02$ j.pl
same
bash-2.02$
So == works but looks like sybase is not returning the same floatie to you
every time. :-)
-R
-----Original Message-----
From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org] On
Behalf Of Srinivasan, Ravikumar
Sent: Wednesday, November 02, 2005 5:05 PM
To: 'Greg Earle'; sybperl-l@peppler.org
Subject: RE: DBD::Sybase 1.07 install on Solaris 8 - failing t/exec.t test
#11
I think the best would be to comment out that line itself.
Floats don't like you it seems. ;)
-R
-----Original Message-----
From: owner-sybperl-l@peppler.org [mailto:owner-sybperl-l@peppler.org] On
Behalf Of Greg Earle
Sent: Wednesday, November 02, 2005 4:48 PM
To: sybperl-l@peppler.org
Subject: Re: DBD::Sybase 1.07 install on Solaris 8 - failing t/exec.t test
#11
On Nov 2, 2005, at 1:26 PM, Alan Olsen wrote:
>> -----Original Message-----
>> From: owner-sybperl-l@peppler.org
>> [mailto:owner-sybperl-l@peppler.org]On
>> Behalf Of Greg Earle
>> Sent: Wednesday, November 02, 2005 1:10 PM
>> To: sybperl-l@peppler.org
>> Subject: Re: DBD::Sybase 1.07 install on Solaris 8 - failing t/exec.t
>> test #11
>>
>> On Nov 2, 2005, at 12:15 PM, Srinivasan, Ravikumar wrote:
>>> I would think this is a sybase feature :-)
>>>
>>> Floats tend to do this from time to time.
>>> Reason I tend use decimal instead.
>>
>> So, what's the consensus - do I just change the test in exec.t
>> to match my returned mutant results? :-) And do a "make test"
>> and "make install" manually, ignoring the mismatched results?
>
> Or the test could be changed to check for a range to account for the
> floatiness of float.
Just for grins, I tried to make the check match the returned
result exactly:
solaris8:1:46 [/.cpan/build/DBD-Sybase-1.07] # sed -n '85,90p' t/exec.t
$rc = $sth->execute(undef, 25, 3.2234, "jan 3 2001", 5.4);
ok(defined($rc), "exec dbitest 3");
my @out = $sth->func('syb_output_params');
#print "@out\n";
ok($out[0] == 5.40000000000000035527136788005009, "out param 1");
But it still fails:
solaris8:1:47 [/.cpan/build/DBD-Sybase-1.07] # make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/autocommit....ok
t/base..........ok
t/exec..........NOK 11
# Failed test (t/exec.t at line 89)
# Looks like you failed 1 test of 22.
t/exec..........dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 11
Failed 1/22 tests, 95.45% okay
Maybe it's not comparing "$out[0]" to the 5.400000... as a
float vs. float?
- Greg
|