Author: timbo
Date: Wed Jan 11 05:20:11 2006
New Revision: 2387

Modified:
   dbi/trunk/Changes
   dbi/trunk/t/40profile.t
Log:
Fixed t/40profile.t to be insensitive to long double precision.


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Wed Jan 11 05:20:11 2006
@@ -8,6 +8,7 @@ DBI::Changes - List of significant chang
 
   Fixed $dbh->clone method 'signature' thanks to Jeffrey Klein.
   Fixed default ping() method to return false if !$dbh->{Active}.
+  Fixed t/40profile.t to be insensitive to long double precision.
 
   Changed DBI::ProfileData to be more forgiving of systems with
     unstable clocks (where time may go backwards occasionally).

Modified: dbi/trunk/t/40profile.t
==============================================================================
--- dbi/trunk/t/40profile.t     (original)
+++ dbi/trunk/t/40profile.t     Wed Jan 11 05:20:11 2006
@@ -199,7 +199,8 @@ my $total_time = dbi_profile_merge(
     [ 10, 0.51, 0.11, 0.01, 0.22, 1023110000, 1023110010 ],
     [ 15, 0.42, 0.12, 0.02, 0.23, 1023110005, 1023110009 ],
 );        
-ok("@$totals", "25 0.93 0.11 0.01 0.23 1023110000 1023110010");
+$_ = sprintf "%.2f", $_ for @$totals; # avoid precision issues
+ok("@$totals", "25.00 0.93 0.11 0.01 0.23 1023110000.00 1023110010.00");
 ok($total_time, 0.93);
 
 $total_time = dbi_profile_merge(
@@ -208,7 +209,8 @@ $total_time = dbi_profile_merge(
         bar => [ 17, 1.42, 0.12, 0.02, 0.23, 1023110005, 1023110009 ],
     }
 );        
-ok("@$totals", "27 2.93 0.11 0.01 0.23 1023110000 1023110010");
+$_ = sprintf "%.2f", $_ for @$totals; # avoid precision issues
+ok("@$totals", "27.00 2.93 0.11 0.01 0.23 1023110000.00 1023110010.00");
 ok($total_time, 2.93);
 
 # check that output went into the log file

Reply via email to