Author: theory
Date: Mon Aug  9 13:41:47 2010
New Revision: 14317

Modified:
   dbi/trunk/t/16destroy.t

Log:
Fix bad test counts on Win32.

Modified: dbi/trunk/t/16destroy.t
==============================================================================
--- dbi/trunk/t/16destroy.t     (original)
+++ dbi/trunk/t/16destroy.t     Mon Aug  9 13:41:47 2010
@@ -76,12 +76,18 @@
     }
 
     sub DESTROY {
-        if ($expect_active < 0) {
-            exit shift->FETCH('Active') || 0;
+        if ($expect_active < 0) { # inside child
+            my $self = shift;
+            exit $self->FETCH('Active') || 0 unless $^O eq 'MSWin32';
+
+            # On Win32, the forked child is actually a thread. So don't exit,
+            # and report failure directly.
+            fail 'Child should be inactive on DESTROY' if 
$self->FETCH('Active');
+        } else {
+            return $expect_active
+                ? ok( shift->FETCH('Active'), 'Should be active in DESTROY')
+                : ok( !shift->FETCH('Active'), 'Should not be active in 
DESTROY');
         }
-        return $expect_active
-            ? ok( shift->FETCH('Active'), 'Should be active in DESTROY')
-            : ok( !shift->FETCH('Active'), 'Should not be active in DESTROY');
     }
 }
 

Reply via email to