ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/80_ssltest.t
(Generate patch)

Comparing AnyEvent/t/80_ssltest.t (file contents):
Revision 1.7 by root, Fri Aug 12 18:41:31 2011 UTC vs.
Revision 1.8 by root, Sun Aug 14 20:33:24 2011 UTC

1#!/usr/bin/perl 1#!/usr/bin/perl
2 2
3BEGIN { eval "use Net::SSLeay 1.33 (); 1" or ((print "1..0 # SKIP no usable Net::SSLeay\n"), exit 0) } 3BEGIN { eval "use Net::SSLeay 1.33 (); 1" or ((print "1..0 # SKIP no usable Net::SSLeay\n"), exit 0) }
4 4
5use Test::More tests => 410; 5use Test::More tests => 415;
6 6
7no warnings;
7use strict qw(vars subs); 8use strict qw(vars subs);
8 9
9use AnyEvent::Socket; 10use AnyEvent::Socket;
10use AnyEvent::Handle; 11use AnyEvent::Handle;
11use AnyEvent::TLS; 12use AnyEvent::TLS;
12 13
13my $ctx = new AnyEvent::TLS cert_file => $0; 14my $ctx = new AnyEvent::TLS cert_file => $0;
14 15
15for my $mode (1..5) { 16for my $mode (1..5) {
17 ok (1, "mode $mode");
18
16 my $server_done = AnyEvent->condvar; 19 my $server_done = AnyEvent->condvar;
17 my $client_done = AnyEvent->condvar; 20 my $client_done = AnyEvent->condvar;
18 21
19 my $server_port = AnyEvent->condvar; 22 my $server_port = AnyEvent->condvar;
20 23
134 $hd->push_write (packstring => "N", "\x00" x $len); 137 $hd->push_write (packstring => "N", "\x00" x $len);
135 }; 138 };
136 139
137 for my $i (1..$cnt) { 140 for my $i (1..$cnt) {
138 $hd->push_read (line => sub { 141 $hd->push_read (line => sub {
142 my ($i, $cnt, $block) = ($i, $cnt, $block); # 5.8.9. bug workaround
139 my $len = $_[1]; 143 my $len = $_[1];
140 ok (1, "client block $len/1"); 144 ok (1, "client block $len/1");
141 $hd->unshift_read (packstring => "N", sub { 145 $hd->unshift_read (packstring => "N", sub {
142 ok ($len == length $_[1], "client block $len/2"); 146 ok ($len == length $_[1], "client block $len/2");
143 147
144 if ($i != $cnt) { 148 if ($i != $cnt) {
145 $block->(); 149 $block->();
146 } else { 150 } else {
147 ok (1, "client_drain"); 151 ok (1, "client_drain 5");
148 $client_done->send; undef $hd; 152 $client_done->send; undef $hd;
149 } 153 }
150 }); 154 });
151 }); 155 });
152 } 156 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines