/[fuse.before_github]/perl/trunk/test/mknod.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /perl/trunk/test/mknod.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4 - (show annotations)
Thu Nov 11 14:44:15 2004 UTC (19 years, 4 months ago) by mszeredi
File MIME type: application/x-troff
File size: 1236 byte(s)
Initial revision

1 #!/usr/bin/perl
2 use test::helper qw($_real $_point);
3 use Test::More;
4 plan tests => 24;
5 my (@stat);
6 chdir($_point);
7 ok(!(system("touch reg" )>>8),"create normal file");
8 ok(!(system("mknod chr c 2 3")>>8),"create chrdev");
9 ok(!(system("mknod blk b 2 3")>>8),"create blkdev");
10 ok(!(system("mknod fifo p" )>>8),"create fifo");
11 chdir($_real);
12 ok(-e "reg" ,"normal file exists");
13 ok(-e "chr" ,"chrdev exists");
14 ok(-e "blk" ,"blkdev exists");
15 ok(-e "fifo","fifo exists");
16 ok(-f "reg" ,"normal file is normal file");
17 ok(-c "chr" ,"chrdev is chrdev");
18 ok(-b "blk" ,"blkdev is blkdev");
19 ok(-p "fifo","fifo is fifo");
20 @stat = stat("chr");
21 is($stat[6],3+(2<<8),"chrdev has right major,minor");
22 @stat = stat("blk");
23 is($stat[6],3+(2<<8),"blkdev has right major,minor");
24 chdir($_point);
25 ok(-e "reg" ,"normal file exists");
26 ok(-e "chr" ,"chrdev exists");
27 ok(-e "blk" ,"blkdev exists");
28 ok(-e "fifo","fifo exists");
29 ok(-f "reg" ,"normal file is normal file");
30 ok(-c "chr" ,"chrdev is chrdev");
31 ok(-b "blk" ,"blkdev is blkdev");
32 ok(-p "fifo","fifo is fifo");
33 @stat = stat("chr");
34 is($stat[6],3+(2<<8),"chrdev has right major,minor");
35 @stat = stat("blk");
36 is($stat[6],3+(2<<8),"blkdev has right major,minor");
37 map { unlink } qw(reg chr blk fifo);

  ViewVC Help
Powered by ViewVC 1.1.26