ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/t/02_read.t
(Generate patch)

Comparing IO-AIO/t/02_read.t (file contents):
Revision 1.1 by root, Sun Jul 10 17:07:44 2005 UTC vs.
Revision 1.2 by root, Sun Jul 10 18:16:50 2005 UTC

1$| = 1; 1$| = 1;
2 2
3if (-f "/etc/passwd" and -d "/etc") { 3if (-f "/etc/passwd" and -d "/etc") {
4 print "1..3\n"; 4 print "1..2\n";
5} else { 5} else {
6 print "1..0 # Skipped: unexpected /etc and/or /etc/passwd\n"; 6 print "1..0 # Skipped: unexpected /etc and/or /etc/passwd\n";
7 exit; 7 exit;
8} 8}
9 9
22} 22}
23 23
24my $pwd; 24my $pwd;
25 25
26aio_open "/etc/passwd", O_RDONLY, 0, sub { 26aio_open "/etc/passwd", O_RDONLY, 0, sub {
27 print $_[0] >= 0 ? "ok" : "not ok", " 1\n"; 27 print $_[0] ? "ok" : "not ok", " 1\n";
28 print +(open $pwd, "<&$_[0]") ? "ok" : "not ok", " 2\n"; 28 $pwd = $_[0];
29}; 29};
30 30
31pcb; 31pcb;
32 32
33my ($sysread, $aioread); 33my ($sysread, $aioread);
38# I found no way to silence the stupid "uninitialized...subroutine entry" warning. 38# I found no way to silence the stupid "uninitialized...subroutine entry" warning.
39# this is just braindamaged. Don't use -w, it introduces more bugs than it fixes. 39# this is just braindamaged. Don't use -w, it introduces more bugs than it fixes.
40$aioread = ""; 40$aioread = "";
41 41
42aio_read $pwd, 7, 15, $aioread, 0, sub { 42aio_read $pwd, 7, 15, $aioread, 0, sub {
43 print +($aioread eq $sysread) ? "ok" : "not ok", " 3\n"; 43 print +($aioread eq $sysread) ? "ok" : "not ok", " 2\n";
44}; 44};
45 45
46pcb; 46pcb;
47 47

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines