IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17620


Ignore:
Timestamp:
May 9, 2008, 3:15:13 PM (18 years ago)
Author:
jhoblitt
Message:

change listxattr_object() to return an arrayref

Location:
trunk/Nebulous-Server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Changes

    r17546 r17620  
    22
    330.10
     4    - change listxattr_object() to return an arrayref
    45    - change default log level to 'WARN'
    56    - fix _is_valid_object_key() to handle nebulous keys
  • trunk/Nebulous-Server/lib/Nebulous/Server.pm

    r17544 r17620  
    11# Copyright (c) 2004-2008  Joshua Hoblitt
    22#
    3 # $Id: Server.pm,v 1.65 2008-05-06 23:07:27 jhoblitt Exp $
     3# $Id: Server.pm,v 1.66 2008-05-10 01:15:13 jhoblitt Exp $
    44
    55package Nebulous::Server;
     
    794794    $log->debug("leaving");
    795795
    796     return @xattrs;
     796    return \@xattrs;
    797797}
    798798
  • trunk/Nebulous-Server/t/14_server_xattr.t

    r17072 r17620  
    33# Copryight (C) 2007  Joshua Hoblitt
    44#
    5 # $Id: 14_server_xattr.t,v 1.4 2008-03-20 21:10:14 jhoblitt Exp $
     5# $Id: 14_server_xattr.t,v 1.5 2008-05-10 01:11:58 jhoblitt Exp $
    66
    77use strict;
     
    3030    ok($neb->setxattr_object('foo', 'bar', 'baz', 'create'), 'set object xattr');
    3131    {
    32         my @xattrs = $neb->listxattr_object('foo');
     32        my $xattrs = $neb->listxattr_object('foo');
    3333        is(scalar @xattrs, 1, 'number of xattrs');
    34         is($xattrs[0], 'bar', 'xattr name');
     34        is(@$xattrs[0], 'bar', 'xattr name');
    3535    }
    3636
     
    4040    ok($neb->removexattr_object('foo', 'bar'), "remove object xattr");
    4141    {
    42         my @xattrs = $neb->listxattr_object('foo');
    43         is(scalar @xattrs, 0, 'number of xattrs');
     42        my $xattrs = $neb->listxattr_object('foo');
     43        is(scalar @$xattrs, 0, 'number of xattrs');
    4444    }
    4545}
     
    5656   
    5757    {
    58         my @xattrs = $neb->listxattr_object('foo');
    59         is(scalar @xattrs, 2, 'number of xattrs');
    60         is($xattrs[0], 'bar', 'xattr name');
    61         is($xattrs[1], 'bonk', 'xattr name');
     58        my $xattrs = $neb->listxattr_object('foo');
     59        is(scalar @$xattrs, 2, 'number of xattrs');
     60        is(@$xattrs[0], 'bar', 'xattr name');
     61        is(@$xattrs[1], 'bonk', 'xattr name');
    6262    }
    6363
     
    7070    ok($neb->removexattr_object('foo', 'bonk'), "remove object xattr");
    7171    {
    72         my @xattrs = $neb->listxattr_object('foo');
    73         is(scalar @xattrs, 0, 'number of xattrs');
     72        my $xattrs = $neb->listxattr_object('foo');
     73        is(scalar @$xattrs, 0, 'number of xattrs');
    7474    }
    7575}
     
    8686   
    8787    {
    88         my @xattrs = $neb->listxattr_object('foo');
    89         is(scalar @xattrs, 1, 'number of xattrs');
    90         is($xattrs[0], 'bar', 'xattr name');
     88        my $xattrs = $neb->listxattr_object('foo');
     89        is(scalar @$xattrs, 1, 'number of xattrs');
     90        is(@$xattrs[0], 'bar', 'xattr name');
    9191    }
    9292
     
    9696    ok($neb->removexattr_object('foo', 'bar'), "remove object xattr");
    9797    {
    98         my @xattrs = $neb->listxattr_object('foo');
    99         is(scalar @xattrs, 0, 'number of xattrs');
     98        my $xattrs = $neb->listxattr_object('foo');
     99        is(scalar @$xattrs, 0, 'number of xattrs');
    100100    }
    101101}
Note: See TracChangeset for help on using the changeset viewer.