Try Schwern's latest Test::Builder offering on a stock perl and a threaded blead
[dbsrgits/DBIx-Class.git] / t / 73oracle_blob.t
index 46d91f1..ae5a359 100644 (file)
@@ -24,12 +24,11 @@ $ENV{NLS_COMP} = "BINARY";
 $ENV{NLS_LANG} = "AMERICAN";
 
 my $v = do {
-  my $v = DBICTest::Schema->connect($dsn, $user, $pass)->storage->_dbh_get_info(18);
-  $v =~ /^(\d+)\.(\d+)/
-    or die "Unparseable Oracle server version: $v\n";
-
-  sprintf('%d.%03d', $1, $2);
+  my $si = DBICTest::Schema->connect($dsn, $user, $pass)->storage->_server_info;
+  $si->{normalized_dbms_version}
+    or die "Unparseable Oracle server version: $si->{dbms_version}\n";
 };
+
 ##########
 # the recyclebin (new for 10g) sometimes comes in the way
 my $on_connect_sql = $v >= 10 ? ["ALTER SESSION SET recyclebin = OFF"] : [];
@@ -57,7 +56,6 @@ for my $opt (@tryopt) {
 
 sub _run_blob_tests {
 SKIP: {
-TODO: {
   my ($schema, $opt) = @_;
   my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) );
   $binstr{'large'} = $binstr{'small'} x 1024;
@@ -108,7 +106,7 @@ TODO: {
     ok (try { $objs[0]->blob }||'' eq "blob:$str", 'blob inserted/retrieved correctly');
     ok (try { $objs[0]->clob }||'' eq "clob:$str", 'clob inserted/retrieved correctly');
 
-    TODO: {
+    {
       local $TODO = '-like comparison on blobs not tested before ora 10 (fails on 8i)'
         if $schema->storage->_server_info->{normalized_dbms_version} < 10;
 
@@ -158,7 +156,7 @@ TODO: {
   }
 
   $schema->storage->debug ($orig_debug);
-}}
+}
 
   do_clean ($dbh);
 }
@@ -187,10 +185,9 @@ sub do_clean {
 }
 
 END {
-  for ($dbh) {
-    next unless $_;
+  if ($dbh) {
     local $SIG{__WARN__} = sub {};
-    do_clean($_);
-    $_->disconnect;
+    do_clean($dbh);
+    undef $dbh;
   }
 }