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

Comparing IO-AIO/t/01_stat.t (file contents):
Revision 1.5 by root, Sun Jul 17 04:20:04 2011 UTC vs.
Revision 1.6 by root, Sun Jul 17 17:30:15 2011 UTC

1$| = 1; 1$| = 1;
2 2
3if (-f "/etc/passwd" and -d "/etc") { 3if (-f "AIO.xs" and -d "bin") {
4 print "1..10\n"; 4 print "1..10\n";
5} else { 5} else {
6 print "1..0 # Skipped: unexpected /etc and/or /etc/passwd\n"; 6 print "1..0 # Skipped: unexpected bin and/or AIO.xs\n";
7 exit; 7 exit;
8} 8}
9 9
10# relies on /etc/passwd to exist... 10# relies on /etc/passwd to exist...
11 11
19 my $rfd = ""; vec ($rfd, IO::AIO::poll_fileno, 1) = 1; select $rfd, undef, undef, undef; 19 my $rfd = ""; vec ($rfd, IO::AIO::poll_fileno, 1) = 1; select $rfd, undef, undef, undef;
20 IO::AIO::poll_cb; 20 IO::AIO::poll_cb;
21 } 21 }
22} 22}
23 23
24aio_open "/etc/passwd", O_RDONLY, 0, sub { 24aio_open "AIO.xs", O_RDONLY, 0, sub {
25 print $_[0] ? "ok" : "not ok", " 1\n"; 25 print $_[0] ? "ok" : "not ok", " 1\n";
26 26
27 $pwd = $_[0]; 27 $pwd = $_[0];
28}; 28};
29 29
30pcb; 30pcb;
31 31
32aio_stat "/etc", sub { 32aio_stat "bin", sub {
33 print -d _ ? "ok" : "not ok", " 2\n"; 33 print -d _ ? "ok" : "not ok", " 2\n";
34}; 34};
35 35
36pcb; 36pcb;
37 37
38aio_stat "/etc/passwd", sub { 38aio_stat "AIO.xs", sub {
39 @pwd = stat _; 39 @pwd = stat _;
40 print -f _ ? "ok" : "not ok", " 3\n"; 40 print -f _ ? "ok" : "not ok", " 3\n";
41 print eval { lstat _; 1 } ? "not ok" : "ok", " 4\n"; 41 print eval { lstat _; 1 } ? "not ok" : "ok", " 4\n";
42}; 42};
43 43
44pcb; 44pcb;
45 45
46aio_lstat "/etc/passwd", sub { 46aio_lstat "AIO.xs", sub {
47 lstat _; 47 lstat _;
48 print -f _ ? "ok" : "not ok", " 5\n"; 48 print -f _ ? "ok" : "not ok", " 5\n";
49 print eval { stat _; 1 } ? "ok" : "not ok", " 6\n"; 49 print eval { stat _; 1 } ? "ok" : "not ok", " 6\n";
50}; 50};
51 51

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines