Author: mjevans
Date: Tue Dec  8 05:23:08 2009
New Revision: 13654

Modified:
   dbi/trunk/t/90sql_type_cast.t

Log:
Omit some tests on Perl < 5.10.1 due to a change in sv_2nv.


Modified: dbi/trunk/t/90sql_type_cast.t
==============================================================================
--- dbi/trunk/t/90sql_type_cast.t       (original)
+++ dbi/trunk/t/90sql_type_cast.t       Tue Dec  8 05:23:08 2009
@@ -40,11 +40,6 @@
     ['small int cast to int (discard)',
      '99', SQL_INTEGER, DBIstcf_DISCARD_STRING, CAST_OK, q{[99]}],
 
-    ['non numeric cast to double', 'aabb', SQL_DOUBLE, 0,
-     NO_CAST_NO_STRICT, q{["aabb"]}],
-    ['non numeric cast to double (strict)', 'aabb', SQL_DOUBLE,
-     DBIstcf_STRICT, NO_CAST_STRICT, q{["aabb"]}],
-
     ['non numeric cast to numeric', 'aa', SQL_NUMERIC,
      0, NO_CAST_NO_STRICT, q{["aa"]}],
     ['non numeric cast to numeric (strict)', 'aa', SQL_NUMERIC,
@@ -80,6 +75,21 @@
     }
 }
 
+if ($] >= 5.010001) {
+   # Some numeric tests fail the return value test on Perls before 5.10.1
+   # because sv_2nv leaves NOK set - changed in 5.10.1 probably via the
+   # following change:
+   # The public IV and NV flags are now not set if the string
+   # value has trailing "garbage". This behaviour is consistent with not
+   # setting the public IV or NV flags if the value is out of range for the
+   # type.
+   push @tests, (
+    ['non numeric cast to double', 'aabb', SQL_DOUBLE, 0,
+     NO_CAST_NO_STRICT, q{["aabb"]}],
+    ['non numeric cast to double (strict)', 'aabb', SQL_DOUBLE,
+     DBIstcf_STRICT, NO_CAST_STRICT, q{["aabb"]}]
+   );
+}
 
 my $tests = @tests;
 $tests *= 2 if $jx;

Reply via email to