From: Richard D. <ric...@us...> - 2008-04-06 09:21:23
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22776/t Modified Files: 22tie-nonuser.t 32nsnonuser.t Log Message: setattr_warn must die -- too noisy Index: 22tie-nonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/22tie-nonuser.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 22tie-nonuser.t 6 Apr 2008 09:12:48 -0000 1.6 --- 22tie-nonuser.t 6 Apr 2008 09:21:27 -0000 1.7 *************** *** 3,7 **** use strict; use Test::More; - use POSIX qw/setlocale LC_ALL/; BEGIN { --- 3,6 ---- *************** *** 23,33 **** use File::ExtAttr qw(getfattr); - # Use the C locale, so all warnings are in the language we are expecting. - setlocale(LC_ALL, 'C'); - - # Snaffle away the warnings for later analysis. - my $warning; - $SIG{'__WARN__'} = sub { $warning = $_[0] }; - my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); --- 22,25 ---- *************** *** 57,60 **** --- 49,53 ---- my %test_attrs = ( 'foo' => '123', 'bar' => '456' ); my $k; + my $err; foreach $k (sort(keys(%test_attrs))) *************** *** 64,77 **** # Check that creation works. $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); # Check that updating works. $extattr{$k} = "$v$v"; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); --- 57,73 ---- # Check that creation works. $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); # Check that updating works. $extattr{$k} = "$v$v"; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); *************** *** 89,93 **** # Check that creation works. $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); } --- 85,90 ---- # Check that creation works. $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); } Index: 32nsnonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/32nsnonuser.t,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** 32nsnonuser.t 6 Apr 2008 09:12:48 -0000 1.8 --- 32nsnonuser.t 6 Apr 2008 09:21:27 -0000 1.9 *************** *** 7,11 **** use strict; use Test::More; - use POSIX qw/setlocale LC_ALL/; BEGIN { --- 7,10 ---- *************** *** 26,36 **** use File::ExtAttr qw(setfattr getfattr delfattr); - # Use the C locale, so all warnings are in the language we are expecting. - setlocale(LC_ALL, 'C'); - - # Snaffle away the warnings for later analysis. - my $warning; - $SIG{'__WARN__'} = sub { $warning = $_[0] }; - my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); --- 25,28 ---- *************** *** 54,58 **** #set it setfattr($_, "$key", $val, { namespace => 'nonuser' }); ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); #read it back --- 46,51 ---- #set it setfattr($_, "$key", $val, { namespace => 'nonuser' }); ! my $err = int $!; ! is ($err, $!{EOPNOTSUPP}); #read it back *************** *** 61,65 **** #delete it delfattr($_, "$key", { namespace => 'nonuser' }); ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); #check that it's gone --- 54,59 ---- #delete it delfattr($_, "$key", { namespace => 'nonuser' }); ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); #check that it's gone |