From: Steve Peters Date: Fri, 14 Jul 2006 14:38:28 +0000 (+0000) Subject: Skip tests for pathconf() and fpathconf() on HP-UX for X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b44a84e8e81b7ebc4e8c77b9065e66abc3dcb7d;p=p5sagit%2Fp5-mst-13.2.git Skip tests for pathconf() and fpathconf() on HP-UX for _PC_CHOWN_RESTRICTED. The HP-UX manpage suggests not trying to do it, and that the errno will not be set on failure. p4raw-id: //depot/perl@28572 --- diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t index 2c1d2c9..cf04fb5 100644 --- a/ext/POSIX/t/sysconf.t +++ b/ext/POSIX/t/sysconf.t @@ -58,10 +58,14 @@ SKIP: { or skip "could not open current directory ($!)", 3 * @path_consts; for my $constant (@path_consts) { - $r = eval { fpathconf( $fd, eval "$constant()" ) }; - is( $@, '', "calling fpathconf($fd, $constant) " ); - ok( defined $r, "\tchecking that the returned value is defined: $r" ); - ok( looks_like_number($r), "\tchecking that the returned value looks like a number" ); + SKIP: { + skip "_PC_CHOWN_RESTRICTED is unreliable on HP-UX", 3 + if $^O eq "hpux" && $constant eq "_PC_CHOWN_RESTRICTED"; + $r = eval { fpathconf( $fd, eval "$constant()" ) }; + is( $@, '', "calling fpathconf($fd, $constant) " ); + ok( defined $r, "\tchecking that the returned value is defined: $r" ); + ok( looks_like_number($r), "\tchecking that the returned value looks like a number" ); + } } POSIX::close($fd); @@ -69,10 +73,14 @@ SKIP: { # testing pathconf() on a non-terminal file for my $constant (@path_consts) { - $r = eval { pathconf( $curdir, eval "$constant()" ) }; - is( $@, '', qq[calling pathconf("$curdir", $constant)] ); - ok( defined $r, "\tchecking that the returned value is defined: $r" ); - ok( looks_like_number($r), "\tchecking that the returned value looks like a number" ); + SKIP: { + skip "_PC_CHOWN_RESTRICTED is unreliable on HP-UX", 3 + if $^O eq "hpux" && $constant eq "_PC_CHOWN_RESTRICTED"; + $r = eval { pathconf( $curdir, eval "$constant()" ) }; + is( $@, '', qq[calling pathconf("$curdir", $constant)] ); + ok( defined $r, "\tchecking that the returned value is defined: $r" ); + ok( looks_like_number($r), "\tchecking that the returned value looks like a number" ); + } } SKIP: {