[svn:dbd-oracle] r14943 - dbd-oracle/trunk/t

[email protected] Wed, 12 Oct 2011 10:22:10 -0700 (PDT)
Newsgroups perl.dbd.oracle.changes
Message-ID <[email protected]>
Author: yanick
Date: Wed Oct 12 10:22:10 2011
New Revision: 14943

Modified:
   dbd-oracle/trunk/t/01base.t
   dbd-oracle/trunk/t/10general.t
   dbd-oracle/trunk/t/15nls.t
   dbd-oracle/trunk/t/20select.t
   dbd-oracle/trunk/t/22nchar_utf8.t
   dbd-oracle/trunk/t/23wide_db.t
   dbd-oracle/trunk/t/23wide_db_al32utf8.t
   dbd-oracle/trunk/t/24implicit_utf8.t
   dbd-oracle/trunk/t/25plsql.t
   dbd-oracle/trunk/t/31lob_extended.t
   dbd-oracle/trunk/t/36lob_leak.t
   dbd-oracle/trunk/t/40ph_type.t
   dbd-oracle/trunk/t/50cursor.t
   dbd-oracle/trunk/t/55nested.t
   dbd-oracle/trunk/t/70meta.t
   dbd-oracle/trunk/t/nchar_test_lib.pl

Log:
Merge branch 'master' into HEAD

Modified: dbd-oracle/trunk/t/01base.t
==============================================================================
--- dbd-oracle/trunk/t/01base.t	(original)
+++ dbd-oracle/trunk/t/01base.t	Wed Oct 12 10:22:10 2011
@@ -3,8 +3,7 @@
 # Base DBD Driver Test
 use Test::More tests => 6;
 
-diag('Test loading DBI, DBD::Oracle and version');
-require_ok(DBI);
+require_ok('DBI');
 
 eval {
     import DBI;

Modified: dbd-oracle/trunk/t/10general.t
==============================================================================
--- dbd-oracle/trunk/t/10general.t	(original)
+++ dbd-oracle/trunk/t/10general.t	Wed Oct 12 10:22:10 2011
@@ -13,8 +13,6 @@
 
 $| = 1;
 
-diag('Test preparsing, Active, NLS_NUMERIC_CHARACTERS, err, ping and OCI version');
-
 my $dsn = oracle_test_dsn();
 my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
 
@@ -105,10 +103,10 @@
 ok( $dbh->ping, 'ping - connected');
 
 my $ora_oci = DBD::Oracle::ORA_OCI(); # dualvar
-printf "ORA_OCI = %d (%s)\n", $ora_oci, $ora_oci;
+note sprintf "ORA_OCI = %d (%s)\n", $ora_oci, $ora_oci;
+
 ok("$ora_oci", 'ora_oci defined');
-ok($ora_oci >= 8, 'ora_oci >= 8');
-diag($ora_oci);
+ok($ora_oci >= 8, "ora_oci $ora_oci >= 8");
 my @ora_oci = split(/\./, $ora_oci,-1);
 ok(scalar @ora_oci >= 2, 'version has 2 or more components');
 ok((scalar @ora_oci == grep { DBI::looks_like_number($_) } @ora_oci),

Modified: dbd-oracle/trunk/t/15nls.t
==============================================================================
--- dbd-oracle/trunk/t/15nls.t	(original)
+++ dbd-oracle/trunk/t/15nls.t	Wed Oct 12 10:22:10 2011
@@ -12,7 +12,6 @@
 
 $| = 1;
 
-diag('test nls_date_format, ora_can_unicode');
 my $dsn = oracle_test_dsn();
 my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
 

Modified: dbd-oracle/trunk/t/20select.t
==============================================================================
--- dbd-oracle/trunk/t/20select.t	(original)
+++ dbd-oracle/trunk/t/20select.t	Wed Oct 12 10:22:10 2011
@@ -44,7 +44,8 @@
     plan skip_all => "Unable to connect to oracle\n";
 }
 
-diag('test simple select statements with [utf8]');
+# test simple select statements with [utf8]
+
 my $utf8_test = ($] >= 5.006)
 	&& client_ochar_is_utf8() # for correct output (utf8 bind vars should be fine regardless)
 	&& ($dbh->ora_can_unicode() & 2);

Modified: dbd-oracle/trunk/t/22nchar_utf8.t
==============================================================================
--- dbd-oracle/trunk/t/22nchar_utf8.t	(original)
+++ dbd-oracle/trunk/t/22nchar_utf8.t	Wed Oct 12 10:22:10 2011
@@ -24,14 +24,15 @@
 
     plan skip_all => "Unable to connect to Oracle" if not $dbh;
     plan skip_all => "Database NCHAR character set is not Unicode" if not db_nchar_is_utf($dbh) ;
-    diag("testing utf8 with nchar columns\n");
+
+    # testing utf8 with nchar columns
 
     show_db_charsets( $dbh );
     my $tdata = test_data( 'wide_nchar' );
 
     if ( $dbh->ora_can_unicode & 1 ) {
         push( @{$tdata->{rows}} ,extra_wide_rows() ) ;
-        diag(" --- added 2 rows with extra wide chars to test data\n");
+        # added 2 rows with extra wide chars to test data
     }
 
     my $testcount = 0 #create table

Modified: dbd-oracle/trunk/t/23wide_db.t
==============================================================================
--- dbd-oracle/trunk/t/23wide_db.t	(original)
+++ dbd-oracle/trunk/t/23wide_db.t	Wed Oct 12 10:22:10 2011
@@ -27,7 +27,8 @@
 
     plan skip_all => "Unable to connect to Oracle" if not $dbh;
     plan skip_all => "Database character set is not Unicode" if not db_ochar_is_utf($dbh) ;
-    print "testing utf8 with char columns (wide mode database)\n" ;
+
+    # testing utf8 with char columns (wide mode database)
 
     my $tdata = test_data( 'wide_char' );
     my $testcount = 0 #create table

Modified: dbd-oracle/trunk/t/23wide_db_al32utf8.t
==============================================================================
--- dbd-oracle/trunk/t/23wide_db_al32utf8.t	(original)
+++ dbd-oracle/trunk/t/23wide_db_al32utf8.t	Wed Oct 12 10:22:10 2011
@@ -25,7 +25,7 @@
 
     plan skip_all => "Unable to connect to Oracle" if not $dbh;
     plan skip_all => "Database character set is not Unicode" if not db_ochar_is_utf($dbh) ;
-    diag("testing utf8 with char columns (wide mode database)\n") ;
+    # testing utf8 with char columns (wide mode database)
 
     my $tdata = test_data( 'wide_char' );
     my $testcount = 0 #create table

Modified: dbd-oracle/trunk/t/24implicit_utf8.t
==============================================================================
--- dbd-oracle/trunk/t/24implicit_utf8.t	(original)
+++ dbd-oracle/trunk/t/24implicit_utf8.t	Wed Oct 12 10:22:10 2011
@@ -25,7 +25,7 @@
     plan skip_all => "Database NCHAR character set is not Unicode" if not db_nchar_is_utf($dbh) ;
     $dbh->disconnect();
 
-    diag(" --- testing implicit csform (dbhimp.c sets csform implicitly)\n") ;
+    # testing implicit csform (dbhimp.c sets csform implicitly)
     my $tdata = test_data( 'wide_nchar' );
     my $testcount = 0 
                   + insert_test_count( $tdata )
@@ -39,7 +39,7 @@
     foreach my $nchar_cset (@nchar_cset)  {
         $dbh->disconnect() if $dbh;
 	undef $dbh;
-        diag(" --- testing with NLS_NCHAR=$nchar_cset\n") ;
+        # testing with NLS_NCHAR=$nchar_cset
         SKIP: { 
             set_nls_nchar( $nchar_cset ,1 ); 
             $dbh = db_handle();

Modified: dbd-oracle/trunk/t/25plsql.t
==============================================================================
--- dbd-oracle/trunk/t/25plsql.t	(original)
+++ dbd-oracle/trunk/t/25plsql.t	Wed Oct 12 10:22:10 2011
@@ -261,10 +261,9 @@
     is("@r", "@s2", "ref = sql");
 }
 
-diag("test bind_param_inout of param that's not assigned to in executed statement\n");
+# test bind_param_inout of param that's not assigned to in executed statement
 # See http://www.mail-archive.com/[email protected]/msg18835.html
-if (1) {
-    my $sth = $dbh->prepare (q(
+my $sth = $dbh->prepare (q(
     BEGIN
  --     :p1 := :p1 ;
  --     :p2 := :p2 ;
@@ -272,21 +271,23 @@
             :p1 := 'AAA' ;
             :p2 := 'Z' ;
         END IF ;
-    END ;));
+END ;));
+
+{
     my ($p1, $p2, $p3) = ('Hello', 'Y', 'Y') ;
     $sth->bind_param_inout(':p1', \$p1, 30) ;
     $sth->bind_param_inout(':p2', \$p2, 1) ;
     $sth->bind_param_inout(':p3', \$p3, 1) ;
-    diag("Before p1=[$p1] p2=[$p2] p3=[$p3]\n");
+    note("Before p1=[$p1] p2=[$p2] p3=[$p3]\n");
     ok($sth->execute, 'test bind_param_inout for non assigned');
     is($p1, 'Hello', 'p1 ok');
     is($p2, 'Y', 'p2 ok');
     is($p3, 'Y', 'p3 ok');
-    diag("After p1=[$p1] p2=[$p2] p3=[$p3]\n");
+    note("After p1=[$p1] p2=[$p2] p3=[$p3]\n");
 }
 
 SKIP: {
-    diag("test nvarchar2 arg passing to functions\n");
+    # test nvarchar2 arg passing to functions
     # http://www.nntp.perl.org/group/perl.dbi.users/24217
     my $ora_server_version = $dbh->func("ora_server_version");
     skip "Client/server version < 9.0", 15

Modified: dbd-oracle/trunk/t/31lob_extended.t
==============================================================================
--- dbd-oracle/trunk/t/31lob_extended.t	(original)
+++ dbd-oracle/trunk/t/31lob_extended.t	Wed Oct 12 10:22:10 2011
@@ -171,24 +171,21 @@
 }
 
 END {
-    if ($dbh) {
-        local $dbh->{PrintError} = 0;
-        local $dbh->{RaiseError} = 1;
-        eval {$dbh->do(q/drop procedure p_DBD_Oracle_drop_me/);};
-        if ($@) {
-            warn("procedure p_DBD_Oracle_drop_me possibly not dropped" .
-                     "- check - $@\n") if $dbh->err ne '4043';
-        } else {
-            diag("procedure p_DBD_Oracle_drop_me dropped");
-        }
-        eval {drop_table($dbh);};
-        if ($@) {
-            warn("table $table possibly not dropped - check - $@\n")
+    return unless $dbh;
 
-                if $dbh->err ne '942';
-        } else {
-            diag("table $table dropped");
-        }
+    local $dbh->{PrintError} = 0;
+    local $dbh->{RaiseError} = 1;
+
+    eval {$dbh->do(q/drop procedure p_DBD_Oracle_drop_me/);};
+    if ($@) {
+        diag("procedure p_DBD_Oracle_drop_me possibly not dropped" .
+                    "- check - $@\n") if $dbh->err ne '4043';
+    }
+
+    eval {drop_table($dbh);};
+    if ($@) {
+        diag("table $table possibly not dropped - check - $@\n")
+            if $dbh->err ne '942';
     }
-};
+}
 

Modified: dbd-oracle/trunk/t/36lob_leak.t
==============================================================================
--- dbd-oracle/trunk/t/36lob_leak.t	(original)
+++ dbd-oracle/trunk/t/36lob_leak.t	Wed Oct 12 10:22:10 2011
@@ -157,10 +157,10 @@
        if ($function){
           eval {$dbh->do(qq/drop function $function/);};
           if ($@) {
-             warn("function p_DBD_Oracle_drop_me possibly not dropped" .
+             diag("function p_DBD_Oracle_drop_me possibly not dropped" .
                     "- check - $@\n") if $dbh->err ne '4043';
           } else {
-             diag("function p_DBD_Oracle_drop_me dropped");
+             note("function p_DBD_Oracle_drop_me dropped");
           }
        }
    }

Modified: dbd-oracle/trunk/t/40ph_type.t
==============================================================================
--- dbd-oracle/trunk/t/40ph_type.t	(original)
+++ dbd-oracle/trunk/t/40ph_type.t	Wed Oct 12 10:22:10 2011
@@ -100,9 +100,9 @@
       $expect =~ s/\s+$// if $test_info->{chops_space};
       my $ok = ($tmp->{ts}->{vc} eq $expect);
       if (!$ok && $ph_type==1 && $name eq 'VARCHAR2') {
-          warn " Placeholder behaviour for ora_type=1 VARCHAR2 (the default) varies with Oracle version.\n";
-          warn " Oracle 7 didn't strip trailing spaces, Oracle 8 did, until 9.2.x\n";
-          warn " Your system doesn't. If that seems odd, let us know.\n";
+          note " Placeholder behaviour for ora_type=1 VARCHAR2 (the default) varies with Oracle version.\n"
+             . " Oracle 7 didn't strip trailing spaces, Oracle 8 did, until 9.2.x\n"
+             . " Your system doesn't. If that seems odd, let us know.\n";
           $ok = 1;
       }
       ok($ok, sprintf(" using ora_type %d expected %s but got %s for $name",

Modified: dbd-oracle/trunk/t/50cursor.t
==============================================================================
--- dbd-oracle/trunk/t/50cursor.t	(original)
+++ dbd-oracle/trunk/t/50cursor.t	Wed Oct 12 10:22:10 2011
@@ -41,7 +41,8 @@
 
     plan tests => $tests;
 
-    diag("Max cursors: $limit\n");
+    note "Max cursors: $limit";
+
 } else {
     plan skip_all => "Unable to connect to Oracle";
 }

Modified: dbd-oracle/trunk/t/55nested.t
==============================================================================
--- dbd-oracle/trunk/t/55nested.t	(original)
+++ dbd-oracle/trunk/t/55nested.t	Wed Oct 12 10:22:10 2011
@@ -89,7 +89,9 @@
   my $tm_start = DBI::dbi_time();
   $row_count++ while $rs->fetch;
   my $elapsed = DBI::dbi_time() - $tm_start;
-  diag("Fetched $row_count rows ($caption): $elapsed secs.\n");
+
+  note "Fetched $row_count rows ($caption): $elapsed secs.";
+
   return $elapsed;
 }
 

Modified: dbd-oracle/trunk/t/70meta.t
==============================================================================
--- dbd-oracle/trunk/t/70meta.t	(original)
+++ dbd-oracle/trunk/t/70meta.t	Wed Oct 12 10:22:10 2011
@@ -38,20 +38,19 @@
 foreach my $table_info_params (@table_info_params) {
     my ($name) = shift @$table_info_params;
     my $start = time;
-    diag("$name: table_info(".DBI::neat_list($table_info_params).")\n");
+    note("$name: table_info(".DBI::neat_list($table_info_params).")\n");
     my $table_info_sth = $dbh->table_info(@$table_info_params);
     ok($table_info_sth, 'table_info');
     my $data = $table_info_sth->fetchall_arrayref;
     ok($data, 'table_info fetch');
     ok(scalar @$data, 'table_info data returned');
     my $dur = time - $start;
-    diag("$name: ".@$data." rows, $dur seconds\n");
-#   print Dumper($data);
+    note("$name: ".@$data." rows, $dur seconds\n");
 }
 
 my $sql_dbms_version = $dbh->get_info(18);
 ok($sql_dbms_version, 'dbms_version');
-diag("sql_dbms_version=$sql_dbms_version\n");
+note "sql_dbms_version=$sql_dbms_version";
 like($sql_dbms_version, qr/^\d+\.\d+\.\d+$/, 'matched');
 
 $dbh->disconnect;

Modified: dbd-oracle/trunk/t/nchar_test_lib.pl
==============================================================================
--- dbd-oracle/trunk/t/nchar_test_lib.pl	(original)
+++ dbd-oracle/trunk/t/nchar_test_lib.pl	Wed Oct 12 10:22:10 2011
@@ -444,7 +444,7 @@
     # see comments in dbdimp.c for details.
     DBD::Oracle::ora_cygwin_set_env('NLS_NCHAR', $ENV{NLS_NCHAR}||'')
 	if $^O eq 'cygwin';
-    diag(defined ora_env_var("NLS_NCHAR") ?	# defined?
+    note(defined ora_env_var("NLS_NCHAR") ?	# defined?
         "set \$ENV{NLS_NCHAR}=$cset\n" :
         "set \$ENV{NLS_LANG}=undef\n")		# XXX ?
             if defined $verbose;
@@ -453,17 +453,15 @@
 sub set_nls_lang_charset
 {
     my ($lang,$verbose) = @_;
-    if ( $lang ) {
-        $ENV{NLS_LANG} = "AMERICAN_AMERICA.$lang";
-        diag("set \$ENV{NLS_LANG}=AMERICAN_AMERICA.$lang\n") if ( $verbose );
-    } else {
-        $ENV{NLS_LANG} = "";	# not the same as set_nls_nchar() above which uses undef
-        diag("set \$ENV{NLS_LANG}=''\n") if ( $verbose );
-    }
+
+    $ENV{NLS_LANG} = $lang ? "AMERICAN_AMERICA.$lang" : '';
+
+    note "set \$ENV{NLS_LANG='$ENV{NLS_LANG}'";
+
     # Special treatment for environment variables under Cygwin -
     # see comments in dbdimp.c for details.
     DBD::Oracle::ora_cygwin_set_env('NLS_LANG', $ENV{NLS_LANG}||'')
-	if $^O eq 'cygwin';
+        if $^O eq 'cygwin';
 }
 
 sub byte_string {