develooper Front page | perl.dbd.oracle.changes | Postings from March 2012

[svn:dbd-oracle] r15210 - in dbd-oracle/trunk: . t

From:
mjevans
Date:
March 12, 2012 02:44
Subject:
[svn:dbd-oracle] r15210 - in dbd-oracle/trunk: . t
Message ID:
20120312094436.9EE42184B77@xx12.develooper.com
Author: mjevans
Date: Mon Mar 12 02:44:34 2012
New Revision: 15210

Modified:
   dbd-oracle/trunk/Changes
   dbd-oracle/trunk/t/70meta.t
   dbd-oracle/trunk/t/80ora_charset.t
   dbd-oracle/trunk/t/rt74753-utf8-encoded.t

Log:
Changes to ensure test succeeds if you cannot connect to Oracle - as mostly people
installing via CPAN shell cannot.
Typo in skip msg


Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes	(original)
+++ dbd-oracle/trunk/Changes	Mon Mar 12 02:44:34 2012
@@ -10,6 +10,9 @@
    DBD::Oracle. The default maximum size is now 1Mb; above that you
    will still have to set LongReadLen (Martin J. Evans)
 
+ - Fixed 70meta and rt74753-utf8-encoded to not die if you cannot
+   connect to Oracle or you cannot install from cpan if you have not
+   set up a valid Oracle connection.
 
  [DOCUMENTATION]
  - clarification of when StrictlyTyped/DiscardString can be used and

Modified: dbd-oracle/trunk/t/70meta.t
==============================================================================
--- dbd-oracle/trunk/t/70meta.t	(original)
+++ dbd-oracle/trunk/t/70meta.t	Mon Mar 12 02:44:34 2012
@@ -12,10 +12,11 @@
 
 my $dsn = oracle_test_dsn();
 my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError => 1, PrintError => 0 });
+my $dbh = DBI->connect($dsn, $dbuser, '', {PrintError => 0 });
 
 if ($dbh) {
     plan tests=>21;
+    $dbh->{RaiseError} = 1;
 } else {
     plan skip_all => "Unable to connect to Oracle";
 }

Modified: dbd-oracle/trunk/t/80ora_charset.t
==============================================================================
--- dbd-oracle/trunk/t/80ora_charset.t	(original)
+++ dbd-oracle/trunk/t/80ora_charset.t	Mon Mar 12 02:44:34 2012
@@ -51,7 +51,7 @@
 
         plan tests => $testcount;
     } else {
-        plan skip_all => "Unable to connect to Oraclee";
+        plan skip_all => "Unable to connect to Oracle";
     }
 
     show_test_data( $tdata ,0 );

Modified: dbd-oracle/trunk/t/rt74753-utf8-encoded.t
==============================================================================
--- dbd-oracle/trunk/t/rt74753-utf8-encoded.t	(original)
+++ dbd-oracle/trunk/t/rt74753-utf8-encoded.t	Mon Mar 12 02:44:34 2012
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 3;
+use Test::More;
 
 use DBI;
 use Encode;
@@ -18,8 +18,13 @@
 $ENV{NLS_NCHAR} = 'UTF8';
 
 my $dbh = DBI->connect( $dsn, $dbuser, '',  { 
-        PrintError => 0, AutoCommit => 0, RaiseError => 1, 
-},);
+        PrintError => 0, AutoCommit => 0});
+if (!$dbh) {
+    plan skip_all => 'Unable to connect to Oracle';
+} else {
+    plan tests => 3;
+    $dbh->{RaiseError} = 1;
+}
 
 $dbh->do(q(alter session set nls_territory = 'GERMANY'));
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About