Replace all tests that require knowing syscall numbers.
[perl-fuse.git] / test / statfs.t
1 #!/usr/bin/perl
2 use test::helper qw($_real $_point);
3 use Test::More;
4 use Config;
5 use Filesys::Statvfs;
6
7 if ($^O eq 'netbsd' || $^O eq 'darwin') {
8     # Ignoring the f_namelen field; no such animal on OS X statfs(), and
9     # NetBSD's statvfs1(2) syscall doesn't seem to handle f_namelen right
10     # for PUFFS-based filesystems. Not our failure, and mostly irrelevant.
11     plan tests => 6;
12 }
13 else {
14     plan tests => 7;
15 }
16 ok(my @list = (statvfs($_point))[1,2,3,5,6,9]);
17 diag "statfs: ",join(', ', @list);
18 is(shift(@list),4096,'block size');
19 is(shift(@list),1000000,'blocks');
20 is(shift(@list),500000,'blocks free');
21 is(shift(@list),1000000,'files');
22 is(shift(@list),500000,'files free');
23 unless ($^O eq 'netbsd' || $^O eq 'darwin') {
24     is(shift(@list),255,'namelen');
25 }