[svn:dbd-oracle] r14620 - in dbd-oracle/branches/mjevans: . t
[email protected] Thu, 30 Dec 2010 06:58:30 -0800 (PST)
| Newsgroups | perl.dbd.oracle.changes |
|---|---|
| Message-ID | <[email protected]> |
Author: mjevans
Date: Thu Dec 30 06:58:29 2010
New Revision: 14620
Modified:
dbd-oracle/branches/mjevans/Changes
dbd-oracle/branches/mjevans/Makefile.PL
dbd-oracle/branches/mjevans/t/10general.t
dbd-oracle/branches/mjevans/t/12impdata.t
dbd-oracle/branches/mjevans/t/14threads.t
dbd-oracle/branches/mjevans/t/15nls.t
dbd-oracle/branches/mjevans/t/25plsql.t
dbd-oracle/branches/mjevans/t/26exe_array.t
dbd-oracle/branches/mjevans/t/28array_bind.t
dbd-oracle/branches/mjevans/t/30long.t
dbd-oracle/branches/mjevans/t/31lob.t
dbd-oracle/branches/mjevans/t/31lob_extended.t
dbd-oracle/branches/mjevans/t/32xmltype.t
dbd-oracle/branches/mjevans/t/34pres_lobs.t
dbd-oracle/branches/mjevans/t/36lob_leak.t
dbd-oracle/branches/mjevans/t/40ph_type.t
dbd-oracle/branches/mjevans/t/50cursor.t
dbd-oracle/branches/mjevans/t/51scroll.t
dbd-oracle/branches/mjevans/t/55nested.t
dbd-oracle/branches/mjevans/t/56embbeded.t
dbd-oracle/branches/mjevans/t/58object.t
dbd-oracle/branches/mjevans/t/70meta.t
dbd-oracle/branches/mjevans/t/80ora_charset.t
dbd-oracle/branches/mjevans/t/rt64206.t
Log:
Added DBI to PREREQ_PM by Martin J. Evans
Fix rt 64244 - don't bail out, skip tests we cannot connect by Martin J. Evans
some of these may conflict with recent changes John made for double skipping
but I'll sort them when this branch is merged to trunk
Modified: dbd-oracle/branches/mjevans/Changes
==============================================================================
--- dbd-oracle/branches/mjevans/Changes (original)
+++ dbd-oracle/branches/mjevans/Changes Thu Dec 30 06:58:29 2010
@@ -1,6 +1,8 @@
=head1 Changes in DBD-Oracle 1.28 (svn rev NNNNN)
Fix support for quoted table names when binding lobs by Martin J. Evans
+ Added DBI to PREREQ_PM by Martin J. Evans
+ Fix rt 64244 - don't bail out, skip tests we cannot connect by Martin J. Evans
=head1 Changes in DBD-Oracle 1.27 (svn rev 14583)
Modified: dbd-oracle/branches/mjevans/Makefile.PL
==============================================================================
--- dbd-oracle/branches/mjevans/Makefile.PL (original)
+++ dbd-oracle/branches/mjevans/Makefile.PL Thu Dec 30 06:58:29 2010
@@ -46,7 +46,8 @@
my %opts = (
NAME => 'DBD::Oracle',
VERSION_FROM => 'Oracle.pm',
- PREREQ_PM => { "Test::Simple" => 0.40 }, # actually Test::More pkg in T::S dist
+ PREREQ_PM => { "Test::Simple" => 0.40, # actually Test::More pkg in T::S dist
+ "DBI" => 1.51},
EXE_FILES => [ "ora_explain$exe_ext" ],
OBJECT => '$(O_FILES)',
DEFINE => '',
Modified: dbd-oracle/branches/mjevans/t/10general.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/10general.t (original)
+++ dbd-oracle/branches/mjevans/t/10general.t Thu Dec 30 06:58:29 2010
@@ -13,17 +13,16 @@
$| = 1;
-plan tests => 30;
-
diag('Test preparsing, Active, NLS_NUMERIC_CHARACTERS, err, ping and OCI version');
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $dbh = DBI->connect($dsn, $dbuser, '');
-unless($dbh) {
- BAIL_OUT("Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n");
- exit 0;
+if ($dbh) {
+ plan tests => 30;
+} else {
+ plan skip_all => "Unable to connect to Oracle ($DBI::errstr)";
}
my($sth, $p1, $p2, $tmp);
Modified: dbd-oracle/branches/mjevans/t/12impdata.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/12impdata.t (original)
+++ dbd-oracle/branches/mjevans/t/12impdata.t Thu Dec 30 06:58:29 2010
@@ -21,8 +21,6 @@
die $use_threads_err if $use_threads_err; # need threads
}
-use Test::More tests => 7;
-
unshift @INC, 't';
require 'nchar_test_lib.pl';
@@ -30,6 +28,11 @@
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $dbh = DBI->connect( $dsn, $dbuser, '', );
+if ($dbh) {
+ plan tests => 7;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
my $drh = $dbh->{Driver};
my ($sess_1) = $dbh->selectrow_array("select userenv('sessionid') from dual");
Modified: dbd-oracle/branches/mjevans/t/14threads.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/14threads.t (original)
+++ dbd-oracle/branches/mjevans/t/14threads.t Thu Dec 30 06:58:29 2010
@@ -24,11 +24,21 @@
use strict;
use DBI;
-use Test::More tests => 19;
+use Test::More;
unshift @INC, 't';
require 'nchar_test_lib.pl';
+my $dsn = oracle_test_dsn();
+my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
+my $dbh = DBI->connect($dsn, $dbuser, '');
+
+if ($dbh) {
+ plan tests => 19;
+ $dbh->disconnect;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
my $last_session : shared;
our @pool : shared;
Modified: dbd-oracle/branches/mjevans/t/15nls.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/15nls.t (original)
+++ dbd-oracle/branches/mjevans/t/15nls.t Thu Dec 30 06:58:29 2010
@@ -9,7 +9,6 @@
require 'nchar_test_lib.pl';
my $testcount = 9;
-plan tests => $testcount;
$| = 1;
@@ -17,37 +16,36 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-SKIP :
-{
- my $dbh = DBI->connect($dsn, $dbuser, '',
- {
- AutoCommit => 1,
- PrintError => 1,
- });
-
- skip "Unable to connect to Oracle ($DBI::errstr)", $testcount
- unless ($dbh);
+my $dbh = DBI->connect($dsn, $dbuser, '',
+ {
+ AutoCommit => 1,
+ PrintError => 1,
+ });
+if ($dbh) {
+ plan tests => $testcount;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
- my ($nls_parameters_before, $nls_parameters_after);
- my $old_date_format = 'HH24:MI:SS DD/MM/YYYY';
- my $new_date_format = 'YYYYMMDDHH24MISS';
+my ($nls_parameters_before, $nls_parameters_after);
+my $old_date_format = 'HH24:MI:SS DD/MM/YYYY';
+my $new_date_format = 'YYYYMMDDHH24MISS';
- ok($dbh->do("alter session set nls_date_format='$old_date_format'"), 'set date format');
+ok($dbh->do("alter session set nls_date_format='$old_date_format'"), 'set date format');
- like($dbh->ora_can_unicode, qr/^[0123]/, 'ora_can_unicode');
+like($dbh->ora_can_unicode, qr/^[0123]/, 'ora_can_unicode');
- ok($nls_parameters_before = $dbh->ora_nls_parameters, 'fetch ora_nls_parameters');
- is(ref($nls_parameters_before), 'HASH', 'check ora_nls_parameters returned hashref');
- is($nls_parameters_before->{'NLS_DATE_FORMAT'}, $old_date_format, 'check returned nls_date_format');
+ok($nls_parameters_before = $dbh->ora_nls_parameters, 'fetch ora_nls_parameters');
+is(ref($nls_parameters_before), 'HASH', 'check ora_nls_parameters returned hashref');
+is($nls_parameters_before->{'NLS_DATE_FORMAT'}, $old_date_format, 'check returned nls_date_format');
- ok($dbh->do("alter session set nls_date_format='$new_date_format'"), 'alter date format');
- ok(eq_hash($nls_parameters_before, $dbh->ora_nls_parameters), 'check ora_nls_parameters caches old values');
+ok($dbh->do("alter session set nls_date_format='$new_date_format'"), 'alter date format');
+ok(eq_hash($nls_parameters_before, $dbh->ora_nls_parameters), 'check ora_nls_parameters caches old values');
- $nls_parameters_before->{NLS_DATE_FORMAT} = 'foo';
- isnt($nls_parameters_before->{NLS_DATE_FORMAT},
- $dbh->ora_nls_parameters->{NLS_DATE_FORMAT}, 'check ora_nls_parameters returns a copy');
+$nls_parameters_before->{NLS_DATE_FORMAT} = 'foo';
+isnt($nls_parameters_before->{NLS_DATE_FORMAT},
+ $dbh->ora_nls_parameters->{NLS_DATE_FORMAT}, 'check ora_nls_parameters returns a copy');
- is($dbh->ora_nls_parameters(1)->{'NLS_DATE_FORMAT'}, $new_date_format, 'refetch and check new nls_date_format value');
-}
+is($dbh->ora_nls_parameters(1)->{'NLS_DATE_FORMAT'}, $new_date_format, 'refetch and check new nls_date_format value');
__END__
Modified: dbd-oracle/branches/mjevans/t/25plsql.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/25plsql.t (original)
+++ dbd-oracle/branches/mjevans/t/25plsql.t Thu Dec 30 06:58:29 2010
@@ -26,7 +26,7 @@
}
plan tests=>82;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle";
}
Modified: dbd-oracle/branches/mjevans/t/26exe_array.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/26exe_array.t (original)
+++ dbd-oracle/branches/mjevans/t/26exe_array.t Thu Dec 30 06:58:29 2010
@@ -4,7 +4,7 @@
use DBD::Oracle qw(ORA_RSET SQLCS_NCHAR);
use strict;
-use Test::More tests =>17 ;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
@@ -19,20 +19,25 @@
## an ASCII only DB
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
$ENV{NLS_NCHAR} = "US7ASCII";
$ENV{NLS_LANG} = "AMERICAN";
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0,
- ora_envhp => 0,
- });
+my $dbh;
+
+eval {
+ $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0,
+ ora_envhp => 0,
+ })
+};
+if ($dbh) {
+ plan tests => 16;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
# check that our db handle is good
isa_ok($dbh, "DBI::db");
Modified: dbd-oracle/branches/mjevans/t/28array_bind.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/28array_bind.t (original)
+++ dbd-oracle/branches/mjevans/t/28array_bind.t Thu Dec 30 06:58:29 2010
@@ -21,7 +21,7 @@
use DBI;
use DBD::Oracle qw(:ora_types ORA_OCI);
-use Test::More tests => 15;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
@@ -237,7 +237,11 @@
SKIP: {
$dbh = db_connect(0);
- plan skip_all => "Not connected to oracle" if not $dbh;
+ if ($dbh) {
+ plan tests => 15;
+ } else {
+ plan skip_all => "Not connected to oracle" if not $dbh;
+ }
test_varchar2_table_3_tests($dbh);
test_number_table_3_tests($dbh);
Modified: dbd-oracle/branches/mjevans/t/30long.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/30long.t (original)
+++ dbd-oracle/branches/mjevans/t/30long.t Thu Dec 30 06:58:29 2010
@@ -23,8 +23,6 @@
#very odd little thing that took a while to figure out.
#Seems I now have 479 tests which is 9 more so 96 test then -1 to round it off
-plan tests => $tests;
-
$| = 1;
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $table = table();
@@ -42,7 +40,13 @@
my($p1, $p2, $tmp, @tmp);
-my $dbh = db_handle() or BAILOUT("Can't connect to database: $DBI::errstr");
+my $dbh = db_handle();
+if ($dbh) {
+ plan tests => $tests;
+} else {
+ plan skip_all => "Unable to connect to Oracle ($DBI::errstr)";
+}
+
my $ora_server_version = $dbh->func("ora_server_version");
diag("ora_server_version: @$ora_server_version\n");
show_db_charsets($dbh) if $dbh;
Modified: dbd-oracle/branches/mjevans/t/31lob.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/31lob.t (original)
+++ dbd-oracle/branches/mjevans/t/31lob.t Thu Dec 30 06:58:29 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 12;
+use Test::More;
use DBD::Oracle qw(:ora_types);
use DBI;
@@ -13,7 +13,11 @@
SKIP: {
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ if ($dbh) {
+ plan tests => 12;
+ } else {
+ plan skip_all => "Not connected to oracle";
+ }
my $table = table();
drop_table($dbh);
Modified: dbd-oracle/branches/mjevans/t/31lob_extended.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/31lob_extended.t (original)
+++ dbd-oracle/branches/mjevans/t/31lob_extended.t Thu Dec 30 06:58:29 2010
@@ -31,7 +31,7 @@
plan tests => 31;
$dbh->{LongReadLen} = 7000;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
+ plan skip_all => "Unable to connect to Oracle";
diag('Test reported bugs');
}
Modified: dbd-oracle/branches/mjevans/t/32xmltype.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/32xmltype.t (original)
+++ dbd-oracle/branches/mjevans/t/32xmltype.t Thu Dec 30 06:58:29 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 4;
+use Test::More;
use DBD::Oracle qw(:ora_types);
use DBI;
@@ -16,18 +16,20 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 });
-
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+
+if ($dbh) {
+ plan tests => 3;
+} else {
+ plan skip_all => "Not connected to oracle"
+}
# check that our db handle is good
isa_ok($dbh, "DBI::db");
Modified: dbd-oracle/branches/mjevans/t/34pres_lobs.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/34pres_lobs.t (original)
+++ dbd-oracle/branches/mjevans/t/34pres_lobs.t Thu Dec 30 06:58:29 2010
@@ -23,14 +23,19 @@
$| = 1;
-plan tests => 29;
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 ,LongReadLen=>10000000});
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '',
+ { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 ,LongReadLen=>10000000})};
+if ($dbh) {
+ plan tests => 29;
+} else {
+ plan skip_all => "Not connected to oracle";
+}
# check that our db handle is good
my $ora_oci = DBD::Oracle::ORA_OCI(); # dualvar
Modified: dbd-oracle/branches/mjevans/t/36lob_leak.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/36lob_leak.t (original)
+++ dbd-oracle/branches/mjevans/t/36lob_leak.t Thu Dec 30 06:58:29 2010
@@ -28,8 +28,7 @@
if ($dbh) {
plan tests => 7;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\nTests
-skipped.\n";
+ plan skip_all => "Unable to connect to Oracle";
}
# get SID and cached lobs
@@ -160,4 +159,4 @@
diag("function p_DBD_Oracle_drop_me dropped");
}
}
-}
\ No newline at end of file
+}
Modified: dbd-oracle/branches/mjevans/t/40ph_type.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/40ph_type.t (original)
+++ dbd-oracle/branches/mjevans/t/40ph_type.t Thu Dec 30 06:58:29 2010
@@ -40,7 +40,7 @@
plan tests => $tests;
} else {
plan skip_all =>
- "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
+ "Unable to connect to Oracle";
}
eval {
Modified: dbd-oracle/branches/mjevans/t/50cursor.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/50cursor.t (original)
+++ dbd-oracle/branches/mjevans/t/50cursor.t Thu Dec 30 06:58:29 2010
@@ -43,7 +43,7 @@
diag("Max cursors: $limit\n");
} else {
- plan skip_all => "Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle";
}
my @cursors;
Modified: dbd-oracle/branches/mjevans/t/51scroll.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/51scroll.t (original)
+++ dbd-oracle/branches/mjevans/t/51scroll.t Thu Dec 30 06:58:29 2010
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 33;
+use Test::More;
use DBD::Oracle qw(:ora_types :ora_fetch_orient :ora_exe_modes);
use DBI;
@@ -16,16 +16,18 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 });
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+if ($dbh) {
+ plan tests => 32;
+} else {
+ plan skip_all => "Not connected to oracle";
+}
ok ($dbh->{RowCacheSize} = 10);
# check that our db handle is good
Modified: dbd-oracle/branches/mjevans/t/55nested.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/55nested.t (original)
+++ dbd-oracle/branches/mjevans/t/55nested.t Thu Dec 30 06:58:29 2010
@@ -17,7 +17,7 @@
if ($dbh) {
plan tests=> 29;
} else {
- plan skip_all =>"Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all =>"Unable to connect to Oracle";
}
# ref cursors may be slow due to oracle bug 3735785
Modified: dbd-oracle/branches/mjevans/t/56embbeded.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/56embbeded.t (original)
+++ dbd-oracle/branches/mjevans/t/56embbeded.t Thu Dec 30 06:58:29 2010
@@ -4,7 +4,7 @@
use DBD::Oracle qw(ORA_RSET SQLCS_NCHAR);
use strict;
-use Test::More tests =>5;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
@@ -18,16 +18,18 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 });
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+if ($dbh) {
+ plan tests => 4;
+} else {
+ plan skip_all => "Not connected to oracle";
+}
# check that our db handle is good
Modified: dbd-oracle/branches/mjevans/t/58object.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/58object.t (original)
+++ dbd-oracle/branches/mjevans/t/58object.t Thu Dec 30 06:58:29 2010
@@ -5,26 +5,27 @@
use strict;
use Data::Dumper;
-use Test::More tests => 51;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
$| = 1;
-BEGIN {
- use_ok('DBI');
-}
-
$ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD"T"HH24:MI:SS';
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '',{ RaiseError=>1,
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '',{ RaiseError=>1,
AutoCommit=>1,
PrintError => 0,
- ora_objects => 1 });
-
+ ora_objects => 1 })};
+if ($dbh) {
+ plan tests => 50;
+} else {
+ plan skip_all => "Not connected to oracle";
+}
my ($schema) = $dbuser =~ m{^([^/]*)};
# Test ora_objects flag
Modified: dbd-oracle/branches/mjevans/t/70meta.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/70meta.t (original)
+++ dbd-oracle/branches/mjevans/t/70meta.t Thu Dec 30 06:58:29 2010
@@ -17,7 +17,7 @@
if ($dbh) {
plan tests=>13;
} else {
- plan skip_all => "Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle";
}
diag("type_info_all\n");
Modified: dbd-oracle/branches/mjevans/t/80ora_charset.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/80ora_charset.t (original)
+++ dbd-oracle/branches/mjevans/t/80ora_charset.t Thu Dec 30 06:58:29 2010
@@ -43,13 +43,17 @@
# global variables defined in dbdimp.c
$dbh_utf8 = db_connect(1);
}
- $dbh = db_connect(0);
+ my $testcount = 8 + insert_test_count( $tdata );
- plan skip_all => "Not connected to oracle" if not $dbh;
+ $dbh = db_connect(0);
+ if ($dbh) {
+ $dbh->ora_nls_parameters ()->{NLS_CHARACTERSET} =~ m/US7ASCII/ and plan skip_all => "Database is set up as US7ASCII";
- my $testcount = 8 + insert_test_count( $tdata );
+ plan tests => $testcount;
+ } else {
+ plan skip_all => "Not connected to oracle";
+ }
- plan tests => $testcount;
show_test_data( $tdata ,0 );
drop_table($dbh);
@@ -116,7 +120,6 @@
$p->{ora_ncharset} = $ncharset if $ncharset;
my $dbh = DBI->connect($dsn, $dbuser, '', $p);
- $dbh->ora_nls_parameters ()->{NLS_CHARACTERSET} =~ m/US7ASCII/ and plan skip_all => "Database is set up as US7ASCII";
return $dbh;
}
@@ -127,4 +130,4 @@
};
}
-1;
\ No newline at end of file
+1;
Modified: dbd-oracle/branches/mjevans/t/rt64206.t
==============================================================================
--- dbd-oracle/branches/mjevans/t/rt64206.t (original)
+++ dbd-oracle/branches/mjevans/t/rt64206.t Thu Dec 30 06:58:29 2010
@@ -25,12 +25,14 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', {RaiseError => 1});
+my $dbh;
+
+eval {$dbh = DBI->connect($dsn, $dbuser, '', {RaiseError => 1})};
if ($dbh) {
plan tests => 3;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
+ plan skip_all => "Unable to connect to Oracle";
}
my $table = q/"dbd_oracle_drop_me"/;