Browse files

done_testing() removed from END block (RT82506)

... as that was too little, too late.
  • Loading branch information...
1 parent caed5f4 commit d754dbfe2094bc9632e8ce84271ba43d5ddef24d @yanick committed Jan 7, 2013
Showing with 28 additions and 26 deletions.
  1. +4 −0 Changes
  2. +24 −26 t/26exe_array.t
View
4 Changes
@@ -1,6 +1,10 @@
Revision history for DBD::Oracle
{{$NEXT}}
+ - fix t/26exe_array.t in the case of no db connection (RT82506,
+ reported by Peter Rabbitson)
+
+1.54 2013-01-03
- promote 1.53_00 to official release
1.53_00 2012-12-18
View
50 t/26exe_array.t
@@ -13,43 +13,27 @@ use lib 't/lib', 't';
$| = 1;
-my $has_test_nowarnings = 1;
-eval "require Test::NoWarnings";
-$has_test_nowarnings = undef if $@;
-
-my ($dbh, $ea);
+my $has_test_nowarnings = eval "require Test::NoWarnings; 1";
use DBI qw(:sql_types);
use ExecuteArray;
-END {
- if ($dbh && $ea) {
- $ea->drop_table($dbh);
- $dbh->disconnect();
- }
- Test::NoWarnings::had_no_warnings()
- if ($has_test_nowarnings);
- done_testing();
-}
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
$ENV{NLS_NCHAR} = "US7ASCII";
$ENV{NLS_LANG} = "AMERICAN";
-eval {
- $dbh = DBI->connect($dsn, $dbuser, '', {PrintError => 0});
-};
+my $dbh = eval {
+ DBI->connect($dsn, $dbuser, '', {PrintError => 0})
+} or plan skip_all => "Unable to connect to Oracle";
-if (!$dbh) {
- plan skip_all => "Unable to connect to Oracle";
-}
-
-$ea = ExecuteArray->new($dbh, 1); # set odbc_disable_array_operations
+my $ea = ExecuteArray->new($dbh, 1); # set odbc_disable_array_operations
$dbh = $ea->dbh;
$ea->drop_table($dbh);
ok($ea->create_table($dbh), "create test table") or exit 1;
+
$ea->simple($dbh, {array_context => 1, raise => 1});
$ea->simple($dbh, {array_context => 0, raise => 1});
$ea->error($dbh, {array_context => 1, raise => 1});
@@ -61,7 +45,21 @@ $ea->row_wise($dbh, {array_context => 1, raise => 1});
$ea->update($dbh, {array_context => 1, raise => 1});
-$ea->error($dbh, {array_context => 1, raise => 1, notuplestatus => 1});
-$ea->error($dbh, {array_context => 0, raise => 1, notuplestatus => 1});
-$ea->error($dbh, {array_context => 1, raise => 0, notuplestatus => 1});
-$ea->error($dbh, {array_context => 0, raise => 0, notuplestatus => 1});
+for my $raise ( 0..1 ) {
+ for my $context ( 0..1 ) {
+ $ea->error($dbh, {
+ array_context => $context,
+ raise => $raise,
+ notuplestatus => 1
+ });
+ }
+}
+
+if ($dbh && $ea) {
+ $ea->drop_table($dbh);
+ $dbh->disconnect();
+}
+
+Test::NoWarnings::had_no_warnings() if $has_test_nowarnings;
+
+done_testing;

0 comments on commit d754dbf

Please sign in to comment.