--- AnyEvent/t/65_event_09_multi.t 2011/08/02 22:07:17 1.1 +++ AnyEvent/t/65_event_09_multi.t 2011/08/12 18:41:28 1.4 @@ -1,9 +1,28 @@ +BEGIN { + # check for broken perls + if ($^O =~ /mswin32/i) { + my $ok; + local $SIG{CHLD} = sub { $ok = 1 }; + kill 'CHLD', 0; + + unless ($ok) { + print <begin; my $wa = AE::io $a, 1, sub { $cv->end; $s |= 1 }; @@ -26,7 +45,7 @@ # I/O read { my $cv = AE::cv; - my $wt = AE::timer 0.1, 0, $cv; + my $wt = AE::timer 0.01, 0, $cv; my $s = 0; my $wa = AE::io $a, 0, sub { $cv->end; $s |= 1 }; @@ -39,7 +58,7 @@ syswrite $b, "x"; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 1, 0, $cv; $s = 0; $cv->begin; @@ -51,7 +70,7 @@ sysread $a, my $dummy, 1; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 0.01, 0, $cv; $s = 0; $cv->recv; @@ -62,7 +81,7 @@ # signal { my $cv = AE::cv; - my $wt = AE::timer 0.1, 0, $cv; + my $wt = AE::timer 0.01, 0, $cv; my $s = 0; $cv->begin; my $wa = AE::signal INT => sub { $cv->end; $s |= 1 }; @@ -75,7 +94,7 @@ kill INT => $$; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 0.01, 0, $cv; $s = 0; $cv->recv; @@ -83,7 +102,7 @@ print $s == 3 ? "" : "not ", "ok 7 # $s\n"; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 0.01, 0, $cv; $s = 0; $cv->recv; @@ -96,7 +115,7 @@ # child { my $cv = AE::cv; - my $wt = AE::timer 0.1, 0, $cv; + my $wt = AE::timer 0.01, 0, $cv; my $s = 0; my $pid = fork; @@ -118,7 +137,7 @@ kill 9, $pid; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 0.01, 0, $cv; $s = 0; $cv->recv; @@ -128,7 +147,7 @@ print $astatus == 9 && $bstatus == 9 ? "" : "not ", "ok 12 # $astatus == $bstatus == 9\n"; $cv = AE::cv; - $wt = AE::timer 0.1, 0, $cv; + $wt = AE::timer 0.01, 0, $cv; $s = 0; $cv->recv; @@ -136,7 +155,22 @@ print $s == 0 ? "" : "not ", "ok 13 # $s\n"; } -print "ok 14\n"; +# timers (don't laugh, some event loops are more broken...) +{ + my $cv = AE::cv; + my $wt = AE::timer 1, 0, $cv; + my $s = 0; + + $cv->begin; my $wa = AE::timer 0 , 0, sub { $cv->end; $s |= 1 }; + $cv->begin; my $wb = AE::timer 0 , 0, sub { $cv->end; $s |= 2 }; + $cv->begin; my $wc = AE::timer 0.01, 0, sub { $cv->end; $s |= 4 }; + + $cv->recv; + + print $s == 7 ? "" : "not ", "ok 14 # $s\n"; +} + +print "ok 15\n"; exit 0;