perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: modperl-2.0/t/response/TestAPR base64.pm brigade.pm bucket.pm date.pm finfo.pm flatten.pm ipsubnet.pm perlio.pm pool.pm sockaddr.pm socket.pm table.pm uri.pm
Date Thu, 08 Jul 2004 06:06:33 GMT
randyk      2004/07/07 23:06:33

  Modified:    t/apr    constants.t
               t/response/TestAPR base64.pm brigade.pm bucket.pm date.pm
                        finfo.pm flatten.pm ipsubnet.pm perlio.pm pool.pm
                        sockaddr.pm socket.pm table.pm uri.pm
  Log:
  change order of args in t_cmp in t/apr tests to use new
  ($expected, $received, $comment) syntax.
  
  Revision  Changes    Path
  1.4       +4 -4      modperl-2.0/t/apr/constants.t
  
  Index: constants.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/apr/constants.t,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- constants.t	17 Nov 2003 23:00:07 -0000	1.3
  +++ constants.t	8 Jul 2004 06:06:33 -0000	1.4
  @@ -13,7 +13,7 @@
   plan tests => 5;
   
   ok ! defined &POLLIN;
  -ok t_cmp (0, APR::SUCCESS, 'APR::SUCCESS');
  -ok t_cmp (0x001, APR::POLLIN, 'APR::POLLIN');
  -ok t_cmp (20, HOOK_LAST, 'HOOK_LAST');
  -ok t_cmp (127, APR::UNKFILE, 'APR::UNKFILE');
  +ok t_cmp (APR::SUCCESS, 0, 'APR::SUCCESS');
  +ok t_cmp (APR::POLLIN, 0x001, 'APR::POLLIN');
  +ok t_cmp (HOOK_LAST, 20, 'HOOK_LAST');
  +ok t_cmp (APR::UNKFILE, 127, 'APR::UNKFILE');
  
  
  
  1.4       +3 -3      modperl-2.0/t/response/TestAPR/base64.pm
  
  Index: base64.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/base64.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- base64.pm	21 May 2004 23:52:07 -0000	1.3
  +++ base64.pm	8 Jul 2004 06:06:33 -0000	1.4
  @@ -21,11 +21,11 @@
       t_debug("encoded string: $encoded");
       ok $encoded;
   
  -    ok t_cmp(length $encoded,
  -             APR::Base64::encode_len(length $str),
  +    ok t_cmp(APR::Base64::encode_len(length $str),
  +             length $encoded,
                "encoded length");
   
  -    ok t_cmp($str, APR::Base64::decode($encoded), "decode");
  +    ok t_cmp(APR::Base64::decode($encoded), $str, "decode");
   
       Apache::OK;
   }
  
  
  
  1.5       +7 -7      modperl-2.0/t/response/TestAPR/brigade.pm
  
  Index: brigade.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/brigade.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- brigade.pm	9 Jun 2004 14:46:22 -0000	1.4
  +++ brigade.pm	8 Jul 2004 06:06:33 -0000	1.5
  @@ -58,10 +58,10 @@
           # concat
           $bb1->concat($bb2);
           # bb1: 11, 12, 21, 22
  -        ok t_cmp(8, $bb1->length, "total data length in bb");
  +        ok t_cmp($bb1->length, 8, "total data length in bb");
           my $len = $bb1->flatten(my $data);
  -        ok t_cmp(8, $len, "bb flatten/len");
  -        ok t_cmp("11122122", $data, "bb flatten/data");
  +        ok t_cmp($len, 8, "bb flatten/len");
  +        ok t_cmp($data, "11122122", "bb flatten/data");
           t_debug('$bb2 is empty');
           ok $bb2->is_empty;
   
  @@ -72,11 +72,11 @@
   
           # bb1: 11, bb3: 12, 21, 22
           $len = $bb1->flatten($data);
  -        ok t_cmp(2, $len, "bb1 flatten/len");
  -        ok t_cmp("11", $data, "bb1 flatten/data");
  +        ok t_cmp($len, 2, "bb1 flatten/len");
  +        ok t_cmp($data, "11", "bb1 flatten/data");
           $len = $bb3->flatten($data);
  -        ok t_cmp(6, $len, "bb3 flatten/len");
  -        ok t_cmp("122122", $data, "bb3 flatten/data");
  +        ok t_cmp($len, 6, "bb3 flatten/len");
  +        ok t_cmp($data, "122122", "bb3 flatten/data");
       }
   
       Apache::OK;
  
  
  
  1.6       +20 -20    modperl-2.0/t/response/TestAPR/bucket.pm
  
  Index: bucket.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/bucket.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- bucket.pm	3 Jul 2004 18:45:46 -0000	1.5
  +++ bucket.pm	8 Jul 2004 06:06:33 -0000	1.6
  @@ -36,9 +36,9 @@
           ok $b->isa('APR::Bucket');
   
           my $type = $b->type;
  -        ok t_cmp('mod_perl SV bucket', $type->name, "type");
  +        ok t_cmp($type->name, 'mod_perl SV bucket', "type");
   
  -        ok t_cmp(length($data), $b->length, "modperl b->length");
  +        ok t_cmp($b->length, length($data), "modperl b->length");
       }
   
       # new: offset
  @@ -48,9 +48,9 @@
           my $real = substr $data, $offset;
           my $b = APR::Bucket->new($data, $offset);
           my $rlen = $b->read(my $read);
  -        ok t_cmp($real, $read, 'new($data, $offset)/buffer');
  -        ok t_cmp(length($read), $rlen, 'new($data, $offset)/len');
  -        ok t_cmp($offset, $b->start, 'offset');
  +        ok t_cmp($read, $real, 'new($data, $offset)/buffer');
  +        ok t_cmp($rlen, length($read), 'new($data, $offset)/len');
  +        ok t_cmp($b->start, $offset, 'offset');
   
       }
   
  @@ -62,8 +62,8 @@
           my $real = substr $data, $offset, $len;
           my $b = APR::Bucket->new($data, $offset, $len);
           my $rlen = $b->read(my $read);
  -        ok t_cmp($real, $read, 'new($data, $offset, $len)/buffer');
  -        ok t_cmp(length($read), $rlen, 'new($data, $offse, $lent)/len');
  +        ok t_cmp($read, $real, 'new($data, $offset, $len)/buffer');
  +        ok t_cmp($rlen, length($read), 'new($data, $offse, $lent)/len');
       }
   
       # new: offset+ too big len
  @@ -94,23 +94,23 @@
       {
           my $b = APR::Bucket::eos_create($ba);
           my $type = $b->type;
  -        ok t_cmp('EOS', $type->name, "eos_create");
  +        ok t_cmp($type->name, 'EOS', "eos_create");
   
  -        ok t_cmp(0, $b->length, "eos b->length");
  +        ok t_cmp($b->length, 0, "eos b->length");
   
           # buckets with no data to read should return an empty string
           my $rlen = $b->read(my $read);
  -        ok t_cmp("", $read, 'eos b->read/buffer');
  -        ok t_cmp(0, $rlen, 'eos b->read/len');
  +        ok t_cmp($read, "", 'eos b->read/buffer');
  +        ok t_cmp($rlen, 0, 'eos b->read/len');
       }
   
       # flush_create
       {
           my $b = APR::Bucket::flush_create($ba);
           my $type = $b->type;
  -        ok t_cmp('FLUSH', $type->name, "flush_create");
  +        ok t_cmp($type->name, 'FLUSH', "flush_create");
   
  -        ok t_cmp(0, $b->length, "flush b->length");
  +        ok t_cmp($b->length, 0, "flush b->length");
       }
   
       # insert_after / insert_before / is_eos / is_flush
  @@ -142,7 +142,7 @@
   
           my $b = $bb->first;
           $b->read(my $read);
  -        ok t_cmp("d1", $read, "d1 bucket");
  +        ok t_cmp($read, "d1", "d1 bucket");
   
           $b = $bb->next($b);
           t_debug("is_flush");
  @@ -150,7 +150,7 @@
   
           $b = $bb->next($b);
           $b->read($read);
  -        ok t_cmp("d2", $read, "d2 bucket");
  +        ok t_cmp($read, "d2", "d2 bucket");
   
           $b = $bb->last();
           t_debug("is_eos");
  @@ -175,21 +175,21 @@
       {
           my $bb = APR::Brigade->new($r->pool, $ba);
   
  -        ok t_cmp(undef, $bb->first, "no first bucket");
  -        ok t_cmp(undef, $bb->last,  "no last bucket");
  +        ok t_cmp($bb->first, undef, "no first bucket");
  +        ok t_cmp($bb->last,  undef, "no last bucket");
   
           ## now there is first
           my $b = APR::Bucket->new("bbb");
           $bb->insert_head($b);
           my $b_first = $bb->first;
           $b->read(my $read);
  -        ok t_cmp("bbb", $read, "first bucket");
  +        ok t_cmp($read, "bbb", "first bucket");
   
           # but there is no prev
  -        ok t_cmp(undef, $bb->prev($b_first),  "no prev bucket");
  +        ok t_cmp($bb->prev($b_first), undef, "no prev bucket");
   
           # and no next
  -        ok t_cmp(undef, $bb->next($b_first),  "no next bucket");
  +        ok t_cmp($bb->next($b_first), undef, "no next bucket");
       }
   
       return Apache::OK;
  
  
  
  1.4       +7 -7      modperl-2.0/t/response/TestAPR/date.pm
  
  Index: date.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/date.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- date.pm	21 May 2004 18:41:30 -0000	1.3
  +++ date.pm	8 Jul 2004 06:06:33 -0000	1.4
  @@ -45,24 +45,24 @@
   
       # parse_http
       for my $date_str (@http_dates) {
  -        ok t_cmp($date_msec, 
  -                 APR::Date::parse_http($date_str),
  -                "parse_http: $date_str");
  +        ok t_cmp(APR::Date::parse_http($date_str),
  +                 $date_msec, 
  +                 "parse_http: $date_str");
           #t_debug "testing : parse_http: $date_str";
       }
   
       # parse_rfc
       for my $date_str (@rfc_dates) {
  -        ok t_cmp($date_msec, 
  -                 APR::Date::parse_rfc($date_str),
  +        ok t_cmp(APR::Date::parse_rfc($date_str),
  +                 $date_msec, 
                    "parse_rfc: $date_str");
           #t_debug "testing : parse_rfc: $date_str";
       }
   
       # parse_rfc (bogus formats)
       for my $date_str (@bogus_dates) {
  -        ok t_cmp($bogus_date_msec,
  -                 APR::Date::parse_rfc($date_str),
  +        ok t_cmp(APR::Date::parse_rfc($date_str),
  +                 $bogus_date_msec,
                    "parse_rfc: $date_str");
           #t_debug "testing : parse_rfc: $date_str";
       }
  
  
  
  1.12      +12 -12    modperl-2.0/t/response/TestAPR/finfo.pm
  
  Index: finfo.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/finfo.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- finfo.pm	24 May 2004 19:55:14 -0000	1.11
  +++ finfo.pm	8 Jul 2004 06:06:33 -0000	1.12
  @@ -77,8 +77,8 @@
                       skip "different file semantics", 0;
                   }
                   else {
  -                    ok t_cmp(${$method},
  -                             $finfo->$method(),
  +                    ok t_cmp($finfo->$method(),
  +                             ${$method},
                                "\$finfo->$method()");
                   }
               }
  @@ -86,20 +86,20 @@
   
           # match world bits
   
  -        ok t_cmp($protection & S_IROTH,
  -                 $finfo->protection & APR::WREAD,
  +        ok t_cmp($finfo->protection & APR::WREAD,
  +                 $protection & S_IROTH,
                    '$finfo->protection() & APR::WREAD');
   
  -        ok t_cmp($protection & S_IWOTH,
  -                 $finfo->protection & APR::WWRITE,
  +        ok t_cmp($finfo->protection & APR::WWRITE,
  +                 $protection & S_IWOTH,
                    '$finfo->protection() & APR::WWRITE');
   
           if (WIN32) {
               skip "different file semantics", 0;
           }
           else {
  -            ok t_cmp($protection & S_IXOTH,
  -                     $finfo->protection & APR::WEXECUTE,
  +            ok t_cmp($finfo->protection & APR::WEXECUTE,
  +                     $protection & S_IXOTH,
                        '$finfo->protection() & APR::WEXECUTE');
           }
       }
  @@ -111,13 +111,13 @@
               skip "finfo.fname requires Apache 2.0.49 or later", 0;
           }
           else {
  -            ok t_cmp($file,
  -                     $finfo->fname,
  +            ok t_cmp($finfo->fname,
  +                     $file,
                        '$finfo->fname()');
           }
   
  -        ok t_cmp(APR::REG,
  -                 $finfo->filetype,
  +        ok t_cmp($finfo->filetype,
  +                 APR::REG,
                    '$finfo->filetype()');
       }
   
  
  
  
  1.6       +13 -13    modperl-2.0/t/response/TestAPR/flatten.pm
  
  Index: flatten.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/flatten.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- flatten.pm	3 Jul 2004 18:45:46 -0000	1.5
  +++ flatten.pm	8 Jul 2004 06:06:33 -0000	1.6
  @@ -32,8 +32,8 @@
       }
   
       # ok, that's 10 buckets of 20,000 = 200,000 characters
  -    ok t_cmp(200000,
  -             $bb->length,
  +    ok t_cmp($bb->length,
  +             200000,
                'APR::Brigade::length()');
   
       # syntax: require a $bb
  @@ -48,7 +48,7 @@
       {
           my $len = $bb->flatten(my $data);
   
  -        verify(200000, $len, $data, 1);
  +        verify($len, 200000, $data, 1);
       }
   
       # flatten(0) returns 0 bytes
  @@ -58,7 +58,7 @@
           t_debug('$bb->flatten(0) returns a defined value');
           ok (defined $data);
   
  -        verify(0, $len, $data, 0);
  +        verify($len, 0, $data, 0);
       }
   
   
  @@ -67,19 +67,19 @@
       {
           # small
           my $len = $bb->flatten(my $data, 30);
  -        verify(30, $len, $data, 1);
  +        verify($len, 30, $data, 1);
       }
   
       {
           # large
           my $len = $bb->flatten(my $data, 190000);
  -        verify(190000, $len, $data, 1);
  +        verify($len, 190000, $data, 1);
       }
   
       {
           # more than enough
           my $len = $bb->flatten(my $data, 300000);
  -        verify(200000, $len, $data, 1);
  +        verify($len, 200000, $data, 1);
       }
   
       # fetch from a brigade with no data in it
  @@ -89,20 +89,20 @@
           t_debug('empty brigade returns a defined value');
           ok (defined $data);
   
  -        verify(0, $len, $data, 0);
  +        verify($len, 0, $data, 0);
       }
   
       Apache::OK;
   }
   
   sub verify {
  -    my($expected_len, $len, $data, $check_content) = @_;
  +    my($len, $expected_len, $data, $check_content) = @_;
   
  -    ok t_cmp($expected_len,
  -             $len,
  -             "\$bb->flatten(\$data, $len) returned $len bytes");
       ok t_cmp($len,
  -             length($data),
  +             $expected_len,
  +             "\$bb->flatten(\$data, $len) returned $len bytes");
  +    ok t_cmp(length($data),
  +             $len,
                "\$bb->flatten(\$data, $len) returned all expected data");
   
       if ($check_content) {
  
  
  
  1.4       +1 -1      modperl-2.0/t/response/TestAPR/ipsubnet.pm
  
  Index: ipsubnet.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/ipsubnet.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ipsubnet.pm	3 Jul 2004 18:45:46 -0000	1.3
  +++ ipsubnet.pm	8 Jul 2004 06:06:33 -0000	1.4
  @@ -25,7 +25,7 @@
   
       ok $ip;
   
  -    ok t_cmp($ip, $c->remote_addr->ip_get,
  +    ok t_cmp($c->remote_addr->ip_get, $ip,
                "remote_ip eq remote_addr->ip_get");
   
       {
  
  
  
  1.27      +40 -40    modperl-2.0/t/response/TestAPR/perlio.pm
  
  Index: perlio.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- perlio.pm	4 Oct 2003 03:10:48 -0000	1.26
  +++ perlio.pm	8 Jul 2004 06:06:33 -0000	1.27
  @@ -75,8 +75,8 @@
               close $fh;
           }
           else {
  -            ok t_cmp($errno_string,
  -                     "$!",
  +            ok t_cmp("$!",
  +                     $errno_string,
                        "expected failure");
           }
       }
  @@ -94,8 +94,8 @@
           my $pos = 3; # rewinds after reading 6 chars above
           seek $fh, $pos, Fcntl::SEEK_SET();
           my $got = tell($fh);
  -        ok t_cmp($pos,
  -                 $got,
  +        ok t_cmp($got,
  +                 $pos,
                    "seek/tell the file Fcntl::SEEK_SET");
   
           # Fcntl::SEEK_CUR()
  @@ -103,16 +103,16 @@
           $pos = tell($fh) + $step;
           seek $fh, $step, Fcntl::SEEK_CUR();
           $got = tell($fh);
  -        ok t_cmp($pos,
  -                 $got,
  +        ok t_cmp($got,
  +                 $pos,
                    "seek/tell the file Fcntl::SEEK_CUR");
   
           # Fcntl::SEEK_END()
           $pos = -s $file;
           seek $fh, 0, Fcntl::SEEK_END();
           $got = tell($fh);
  -        ok t_cmp($pos,
  -                 $got,
  +        ok t_cmp($got,
  +                 $pos,
                    "seek/tell the file Fcntl::SEEK_END");
   
           close $fh;
  @@ -127,16 +127,16 @@
           ok ref($fh) eq 'GLOB';
   
           # basic single line read
  -        ok t_cmp($expected,
  -                 scalar(<$fh>),
  +        ok t_cmp(scalar(<$fh>),
  +                 $expected,
                    "single line read");
   
           # slurp mode
           seek $fh, 0, Fcntl::SEEK_SET(); # rewind to the start
           local $/;
   
  -        ok t_cmp($expected_all,
  -                 scalar(<$fh>),
  +        ok t_cmp(scalar(<$fh>),
  +                 $expected_all,
                    "slurp file");
   
           # test ungetc (a long sep requires read ahead)
  @@ -144,8 +144,8 @@
           local $/ = $sep;
           my @got_lines = <$fh>;
           my @expect = ($lines[0] . $sep, $lines[1]);
  -        ok t_cmp(\@expect,
  -                 \@got_lines,
  +        ok t_cmp(\@got_lines,
  +                 \@expect,
                    "custom complex input record sep read");
   
           close $fh;
  @@ -166,8 +166,8 @@
   
           t_debug($received);
   
  -        ok t_cmp(1,
  -                 eof($fh),
  +        ok t_cmp(eof($fh),
  +                 1,
                    "end of file");
           close $fh;
       }
  @@ -186,8 +186,8 @@
   
           close $dup_fh;
           unless (APR_WIN32_FILE_DUP_BUG) {
  -            ok t_cmp($expected,
  -                     $received,
  +            ok t_cmp($received,
  +                     $expected,
                        "read/write a dupped file");
           }
       }
  @@ -204,16 +204,16 @@
           my $oldfh = select($wfh); $| = 1; select($oldfh);
           print $wfh $expected; # must be flushed to disk immediately
   
  -        ok t_cmp($expected,
  -                 scalar(<$rfh>),
  +        ok t_cmp(scalar(<$rfh>),
  +                 $expected,
                    "file unbuffered write");
   
           # buffer up
           $oldfh = select($wfh); $| = 0; select($oldfh);
           print $wfh $expected; # should be buffered up and not flushed
   
  -        ok t_cmp(undef,
  -                 scalar(<$rfh>),
  +        ok t_cmp(scalar(<$rfh>),
  +                 undef,
                    "file buffered write");
   
           close $wfh;
  @@ -242,16 +242,16 @@
                   $perl_content = <$pfh>;
               }
               close $pfh;
  -            ok t_cmp(length $perl_content,
  -                     length $apr_content,
  +            ok t_cmp(length $apr_content,
  +                     length $perl_content,
                        "testing data size of $file");
           
               open my $wfh, ">:APR", $out, $r->pool
                   or die "Cannot open $out for writing: $!";
               print $wfh $apr_content;
               close $wfh;
  -            ok t_cmp(-s $in,
  -                     -s $out,
  +            ok t_cmp(-s $out,
  +                     -s $in,
                        "testing file size of $file");
               unlink $out;
           }
  @@ -273,11 +273,11 @@
               $text = <$rfh>;
           }
           close $rfh;
  -        ok t_cmp($count,
  -                 count_chars($text, Apache::CRLF),
  +        ok t_cmp(count_chars($text, Apache::CRLF),
  +                 $count,
                    'testing for presence of \015\012');
  -        ok t_cmp($count,
  -                 count_chars($text, "\n"),
  +        ok t_cmp(count_chars($text, "\n"),
  +                 $count,
                    'testing for presence of \n');
   
           open $wfh, ">:APR", $scratch, $r->pool
  @@ -291,11 +291,11 @@
               $text = <$rfh>;
           }
           close $rfh;
  -        ok t_cmp($count,
  -                 count_chars($text, Apache::CRLF),
  +        ok t_cmp(count_chars($text, Apache::CRLF),
  +                 $count,
                    'testing for presence of \015\012');
  -        ok t_cmp($count,
  -                 count_chars($text, "\n"),
  +        ok t_cmp(count_chars($text, "\n"),
  +                 $count,
                    'testing for presence of \n');
           open $rfh, "<:crlf", $scratch
               or die "Cannot open $scratch for reading: $!";
  @@ -304,11 +304,11 @@
               $text = <$rfh>;
           }
           close $rfh;
  -        ok t_cmp(0,
  -                 count_chars($text, Apache::CRLF),
  +        ok t_cmp(count_chars($text, Apache::CRLF),
  +                 0,
                    'testing for presence of \015\012');
  -        ok t_cmp($count,
  -                 count_chars($text, "\n"),
  +        ok t_cmp(count_chars($text, "\n"),
  +                 $count,
                    'testing for presence of \n');
   
           my $utf8 = "\x{042F} \x{0432}\x{0430}\x{0441} \x{043B}\x{044E}";
  @@ -325,8 +325,8 @@
               $text = <$rfh>;
           }
           close $rfh;
  -        ok t_cmp($utf8,
  -                 $text,
  +        ok t_cmp($text,
  +                 $utf8,
                    'utf8 binmode test');
           unlink $scratch;
       }
  
  
  
  1.17      +24 -24    modperl-2.0/t/response/TestAPR/pool.pm
  
  Index: pool.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/pool.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- pool.pm	3 Jul 2004 18:45:46 -0000	1.16
  +++ pool.pm	8 Jul 2004 06:06:33 -0000	1.17
  @@ -34,7 +34,7 @@
   
           my @notes = $r->notes->get('cleanup');
   
  -        ok t_cmp(0, scalar(@notes), "should be 0 notes");
  +        ok t_cmp(scalar(@notes), 0, "should be 0 notes");
   
           $r->notes->clear;
       }
  @@ -54,7 +54,7 @@
   
           my @notes = $r->notes->get('cleanup');
   
  -        ok t_cmp(0, scalar(@notes), "should be 0 notes");
  +        ok t_cmp(scalar(@notes), 0, "should be 0 notes");
   
           $r->notes->clear;
       }
  @@ -69,7 +69,7 @@
   
           $p->cleanup_register(\&set_cleanup, [$r, 'new destroy']);
   
  -        ok t_cmp(1, ancestry_count($p),
  +        ok t_cmp(ancestry_count($p), 1,
                    "a new pool has one ancestor: the global pool");
   
           # explicity destroy the object
  @@ -77,9 +77,9 @@
   
           my @notes = $r->notes->get('cleanup');
   
  -        ok t_cmp(1, scalar(@notes), "should be 1 note");
  +        ok t_cmp(scalar(@notes), 1, "should be 1 note");
   
  -        ok t_cmp('new destroy', $notes[0]);
  +        ok t_cmp($notes[0], 'new destroy');
   
           $r->notes->clear;
       }
  @@ -93,7 +93,7 @@
           {
               my $p = APR::Pool->new;
   
  -            ok t_cmp(1, ancestry_count($p),
  +            ok t_cmp(ancestry_count($p), 1,
                    "a new pool has one ancestor: the global pool");
   
               $p->cleanup_register(\&set_cleanup, [$r, 'new scoped']);
  @@ -101,9 +101,9 @@
   
           my @notes = $r->notes->get('cleanup');
   
  -        ok t_cmp(1, scalar(@notes), "should be 1 note");
  +        ok t_cmp(scalar(@notes), 1, "should be 1 note");
   
  -        ok t_cmp('new scoped', $notes[0]);
  +        ok t_cmp($notes[0], 'new scoped');
   
           $r->notes->clear;
       }
  @@ -187,7 +187,7 @@
           # use the global top level pool for it), so the resulting pool
           # should have an ancestry length of exactly 1
           my $ssp = $sp->new;
  -        ok t_cmp(1, ancestry_count($ssp),
  +        ok t_cmp(ancestry_count($ssp), 1,
                    "a new pool has one ancestor: the global pool");
   
   
  @@ -230,8 +230,8 @@
   
           my @notes = $r->notes->get('cleanup');
   
  -        ok t_cmp(1, scalar(@notes), "should be 1 note");
  -        ok t_cmp('overtake', $notes[0]);
  +        ok t_cmp(scalar(@notes), 1, "should be 1 note");
  +        ok t_cmp($notes[0], 'overtake');
   
           $r->notes->clear;
   
  @@ -268,7 +268,7 @@
   
           # $pp and $sp shouldn't have triggered any cleanups
           my @notes = $r->notes->get('cleanup');
  -        ok t_cmp(0, scalar(@notes), "should be 0 notes");
  +        ok t_cmp(scalar(@notes), 0, "should be 0 notes");
           $r->notes->clear;
   
           # parent pool destroys child pool
  @@ -296,15 +296,15 @@
           }
   
           my @notes = $r->notes->get('cleanup');
  -        ok t_cmp(0, scalar(@notes), "should be 0 notes");
  +        ok t_cmp(scalar(@notes), 0, "should be 0 notes");
           $r->notes->clear;
   
           # now the last copy is gone and the cleanup hooks will be called
           $cp->destroy;
   
           @notes = $r->notes->get('cleanup');
  -        ok t_cmp(1, scalar(@notes), "should be 1 note");
  -        ok t_cmp('several references', $notes[0]);
  +        ok t_cmp(scalar(@notes), 1, "should be 1 note");
  +        ok t_cmp($notes[0], 'several references');
   
           $r->notes->clear;
       }
  @@ -337,7 +337,7 @@
           }
   
           my @notes = $r->notes->get('cleanup');
  -        ok t_cmp('function name', $notes[0], "function name callback");
  +        ok t_cmp($notes[0], 'function name', "function name callback");
   
           $r->notes->clear;
       }
  @@ -351,7 +351,7 @@
           }
   
           my @notes = $r->notes->get('cleanup');
  -        ok t_cmp('anon sub', $notes[0], "anon callback");
  +        ok t_cmp($notes[0], 'anon sub', "anon callback");
   
           $r->notes->clear;
       }
  @@ -366,8 +366,8 @@
           }
   
           my @notes = $r->notes->get('cleanup');
  -        ok t_cmp('second', $notes[0], "two cleanup functions");
  -        ok t_cmp('first',  $notes[1], "two cleanup functions");
  +        ok t_cmp($notes[0], 'second', "two cleanup functions");
  +        ok t_cmp($notes[1], 'first',  "two cleanup functions");
   
           $r->notes->clear;
       }
  @@ -494,9 +494,9 @@
   
       my $sp = $pp->new;
   
  -    ok t_cmp(1, $sp->isa('APR::Pool'), "isa('APR::Pool')");
  +    ok t_cmp($sp->isa('APR::Pool'), 1, "isa('APR::Pool')");
   
  -    ok t_cmp(2, ancestry_count($sp),
  +    ok t_cmp(ancestry_count($sp), 2,
                "a subpool has 2 ancestors: the parent and global pools");
   
       $pp->cleanup_register(\&add_cleanup, [$r, 'parent']);
  @@ -511,9 +511,9 @@
       my $r = shift;
       my @notes = $r->notes->get('cleanup');
   
  -    ok t_cmp(2, scalar(@notes), "should be 2 notes");
  -    ok t_cmp('child', $notes[0]);
  -    ok t_cmp('parent', $notes[1]);
  +    ok t_cmp(scalar(@notes), 2, "should be 2 notes");
  +    ok t_cmp($notes[0], 'child');
  +    ok t_cmp($notes[1], 'parent');
   }
   
   1;
  
  
  
  1.2       +4 -4      modperl-2.0/t/response/TestAPR/sockaddr.pm
  
  Index: sockaddr.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/sockaddr.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sockaddr.pm	17 May 2004 07:44:03 -0000	1.1
  +++ sockaddr.pm	8 Jul 2004 06:06:33 -0000	1.2
  @@ -23,12 +23,12 @@
       my $local  = $c->local_addr;
       my $remote = $c->remote_addr;
   
  -    ok t_cmp($c->local_ip,  $local->ip_get,  "local ip");
  -    ok t_cmp($c->remote_ip, $remote->ip_get, "remote ip");
  +    ok t_cmp($local->ip_get,  $c->local_ip,  "local ip");
  +    ok t_cmp($remote->ip_get, $c->remote_ip, "remote ip");
   
       $r->subprocess_env;
  -    ok t_cmp($ENV{SERVER_PORT}, $local->port,  "local port");
  -    ok t_cmp($ENV{REMOTE_PORT}, $remote->port, "remote port");
  +    ok t_cmp($local->port,  $ENV{SERVER_PORT}, "local port");
  +    ok t_cmp($remote->port, $ENV{REMOTE_PORT}, "remote port");
   
       Apache::OK;
   }
  
  
  
  1.5       +2 -2      modperl-2.0/t/response/TestAPR/socket.pm
  
  Index: socket.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/socket.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- socket.pm	23 Apr 2004 17:59:00 -0000	1.4
  +++ socket.pm	8 Jul 2004 06:06:33 -0000	1.5
  @@ -34,11 +34,11 @@
   
       my $new_val = 30_000_000; # 30 secs
       $socket->timeout_set($new_val);
  -    ok t_cmp($new_val, $socket->timeout_get(), "timeout_get()");
  +    ok t_cmp($socket->timeout_get(), $new_val, "timeout_get()");
   
       # reset the timeout
       $socket->timeout_set($orig_val);
  -    ok t_cmp($orig_val, $socket->timeout_get(), "timeout_get()");
  +    ok t_cmp($socket->timeout_get(), $orig_val, "timeout_get()");
   
       Apache::OK;
   }
  
  
  
  1.15      +24 -24    modperl-2.0/t/response/TestAPR/table.pm
  
  Index: table.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/table.pm,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- table.pm	16 May 2004 03:21:35 -0000	1.14
  +++ table.pm	8 Jul 2004 06:06:33 -0000	1.15
  @@ -31,11 +31,11 @@
       {
           # in scalar context
           my $val = $table->get('foo');
  -        ok t_cmp(undef, $val, '$val = $table->get("no_such_key")');
  +        ok t_cmp($val, undef, '$val = $table->get("no_such_key")');
   
           # in list context
           my @val = $table->get('foo');
  -        ok t_cmp(0, +@val, '@val = $table->get("no_such_key")');
  +        ok t_cmp(+@val, 0, '@val = $table->get("no_such_key")');
       }
   
       # set/add/get/copy normal values
  @@ -44,7 +44,7 @@
   
           # get scalar context
           my $val = $table->get('foo');
  -        ok t_cmp('bar', $val, '$val = $table->get("foo")');
  +        ok t_cmp($val, 'bar', '$val = $table->get("foo")');
   
           # add + get list context
           $table->add(foo => 'tar');
  @@ -59,7 +59,7 @@
           $table->set(too => 'boo');
           my $table_copy = $table->copy($r->pool);
           my $val_copy = $table->get('too');
  -        ok t_cmp('boo', $val_copy, '$val = $table->get("too")');
  +        ok t_cmp($val_copy, 'boo', '$val = $table->get("too")');
           my @val_copy = $table_copy->get('foo');
           ok @val_copy == 3         &&
               $val_copy[0] eq 'bar' &&
  @@ -71,14 +71,14 @@
       {
           $table->set(foo => 0);
           my $zero = $table->get('foo');
  -        ok t_cmp(0, $zero, 'table value 0 is not undef');
  +        ok t_cmp($zero, 0, 'table value 0 is not undef');
       }
   
       # unset
       {
           $table->set(foo => "bar");
           $table->unset('foo');
  -        ok t_cmp(undef, +$table->get('foo'), '$table->unset("foo")');
  +        ok t_cmp(+$table->get('foo'), undef, '$table->unset("foo")');
       }
   
       # merge
  @@ -86,20 +86,20 @@
           $table->set(  merge => '1');
           $table->merge(merge => 'a');
           my $val = $table->get('merge');
  -        ok t_cmp("1, a", $val, 'one val $table->merge(...)');
  +        ok t_cmp($val, "1, a", 'one val $table->merge(...)');
   
           # if there is more than one value for the same key, merge does
           # the job only for the first value
           $table->add(  merge => '2');
           $table->merge(merge => 'b');
           my @val = $table->get('merge');
  -        ok t_cmp("1, a, b", $val[0], '$table->merge(...)');
  -        ok t_cmp("2",    $val[1], 'two values $table->merge(...)');
  +        ok t_cmp($val[0], "1, a, b", '$table->merge(...)');
  +        ok t_cmp($val[1], "2",       'two values $table->merge(...)');
   
           # if the key is not found, works like set/add
           $table->merge(miss => 'a');
           my $val_miss = $table->get('miss');
  -        ok t_cmp("a", $val_miss, 'no value $table->merge(...)');
  +        ok t_cmp($val_miss, "a", 'no value $table->merge(...)');
       }
   
       # clear
  @@ -108,8 +108,8 @@
           $table->set(bar => 1);
           $table->clear();
           # t_cmp forces scalar context on get
  -        ok t_cmp(undef, $table->get('foo'), '$table->clear');
  -        ok t_cmp(undef, $table->get('bar'), '$table->clear');
  +        ok t_cmp($table->get('foo'), undef, '$table->clear');
  +        ok t_cmp($table->get('bar'), undef, '$table->clear');
       }
   
       # filtering
  @@ -121,12 +121,12 @@
           # Simple filtering
           $filter_count = 0;
           $table->do("my_filter");
  -        ok t_cmp(TABLE_SIZE, $filter_count);
  +        ok t_cmp($filter_count, TABLE_SIZE);
   
           # Filtering aborting in the middle
           $filter_count = 0;
           $table->do("my_filter_stop");
  -        ok t_cmp(int(TABLE_SIZE)/2, $filter_count) ;
  +        ok t_cmp($filter_count, int(TABLE_SIZE)/2) ;
   
           # Filtering with anon sub
           $filter_count=0;
  @@ -139,11 +139,11 @@
               return 1;
           });
   
  -        ok t_cmp(TABLE_SIZE, $filter_count, "table size");
  +        ok t_cmp($filter_count, TABLE_SIZE, "table size");
   
           $filter_count = 0;
           $table->do("my_filter", "c", "b", "e");
  -        ok t_cmp(3, $filter_count, "table size");
  +        ok t_cmp($filter_count, 3, "table size");
       }
   
       #Tied interface
  @@ -190,8 +190,8 @@
           my @foo = $overlay->get('foo');
           my @bar = $overlay->get('bar');
   
  -        ok t_cmp(3, +@foo);
  -        ok t_cmp('beer', $bar[0]);
  +        ok t_cmp(+@foo, 3);
  +        ok t_cmp($bar[0], 'beer');
   
           my $overlay2 = $overlay->copy($r->pool);
   
  @@ -232,9 +232,9 @@
           my @foo = $base->get('foo');
           my @bar = $base->get('bar');
   
  -        ok t_cmp(1, +@foo, 'overlap/set');
  -        ok t_cmp('three', $foo[0]);
  -        ok t_cmp('beer', $bar[0]);
  +        ok t_cmp(+@foo, 1, 'overlap/set');
  +        ok t_cmp($foo[0], 'three');
  +        ok t_cmp($bar[0], 'beer');
       }
   
       # overlap merge
  @@ -253,9 +253,9 @@
           my @foo = $base->get('foo');
           my @bar = $base->get('bar');
   
  -        ok t_cmp(1, +@foo, 'overlap/set');
  -        ok t_cmp('one, two, three', $foo[0]);
  -        ok t_cmp('beer', $bar[0]);
  +        ok t_cmp(+@foo, 1, 'overlap/set');
  +        ok t_cmp($foo[0], 'one, two, three');
  +        ok t_cmp($bar[0], 'beer');
       }
   
       Apache::OK;
  
  
  
  1.6       +11 -11    modperl-2.0/t/response/TestAPR/uri.pm
  
  Index: uri.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/uri.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- uri.pm	28 May 2004 04:44:39 -0000	1.5
  +++ uri.pm	8 Jul 2004 06:06:33 -0000	1.6
  @@ -61,10 +61,10 @@
   
       for my $method (keys %url) {
           no strict 'refs';
  -        ok t_cmp($url{$method}[0], $parsed->$method, $method);
  +        ok t_cmp($parsed->$method, $url{$method}[0], $method);
       }
   
  -    ok t_cmp($hostinfo0, $parsed->hostinfo, "hostinfo");
  +    ok t_cmp($parsed->hostinfo, $hostinfo0, "hostinfo");
   
       for my $method (keys %url) {
           no strict 'refs';
  @@ -80,14 +80,14 @@
       # record, and it's populated when parse is called, but when
       # individual fields used to compose it are updated, it doesn't get
       # updated: so we see the old value here
  -    ok t_cmp($hostinfo0, $parsed->hostinfo, "hostinfo");
  +    ok t_cmp($parsed->hostinfo, $hostinfo0, "hostinfo");
   
       # - since 21 is the default port for ftp, unparse omits it
       # - if no flags are passed to unparse, APR::URI_UNP_OMITPASSWORD
       #   is passed by default -- it hides the password
       my $url1 = sprintf "%s://%s\@%s%s",
           map { $url{$_}[1] } grep !/^(password|port)$/, @keys_urls;
  -    ok t_cmp($url1, $url_unparsed, "unparsed url");
  +    ok t_cmp($url_unparsed, $url1, "unparsed url");
   
       # various unparse flags #
       {
  @@ -104,7 +104,7 @@
               my $url_unparsed = $parsed->unparse(APR::URI_UNP_OMITSITEPART);
               my $url2 = sprintf "%s?%s#%s",
                   map { $url{$_}[1] } qw(path query fragment);
  -            ok t_cmp($url2, $url_unparsed, "unparsed url: omit site");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url: omit site");
           }
   
           # this time the password should appear as XXXXXXXX
  @@ -113,7 +113,7 @@
               my $url_unparsed = $parsed->unparse(0);
               my $url2 = sprintf "%s://%s:%s\@%s%s?%s#%s",
                   map { $url{$_}[1] } grep !/^port$/, @keys_urls;
  -            ok t_cmp($url2, $url_unparsed, "unparsed url:reveal passwd");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url:reveal passwd");
           }
   
           # this time the user and the password should appear
  @@ -121,7 +121,7 @@
               my $url_unparsed = $parsed->unparse(APR::URI_UNP_REVEALPASSWORD);
               my $url2 = sprintf "%s://%s:%s\@%s%s?%s#%s",
                   map { $url{$_}[1] } grep !/^port$/, @keys_urls;
  -            ok t_cmp($url2, $url_unparsed, "unparsed url:reveal passwd");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url:reveal passwd");
           }
   
           # omit the user part / show password
  @@ -130,7 +130,7 @@
                   APR::URI_UNP_OMITUSER|APR::URI_UNP_REVEALPASSWORD);
               my $url2 = sprintf "%s://:%s\@%s%s?%s#%s",
                   map { $url{$_}[1] } grep !/^(port|user)$/, @keys_urls;
  -            ok t_cmp($url2, $url_unparsed, "unparsed url:  omit user");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url:  omit user");
           }
   
           # omit the path, query and fragment strings
  @@ -139,7 +139,7 @@
                   APR::URI_UNP_OMITPATHINFO|APR::URI_UNP_REVEALPASSWORD);
               my $url2 = sprintf "%s://%s:%s\@%s", map { $url{$_}[1] }
                   grep !/^(port|path|query|fragment)$/, @keys_urls;
  -            ok t_cmp($url2, $url_unparsed, "unparsed url: omit path");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url: omit path");
           }
   
           # omit the query and fragment strings
  @@ -148,14 +148,14 @@
                   APR::URI_UNP_OMITQUERY|APR::URI_UNP_OMITPASSWORD);
               my $url2 = sprintf "%s://%s\@%s%s", map { $url{$_}[1] }
                   grep !/^(password|port|query|fragment)$/, @keys_urls;
  -            ok t_cmp($url2, $url_unparsed, "unparsed url: omit query");
  +            ok t_cmp($url_unparsed, $url2, "unparsed url: omit query");
           }
       }
   
       ### port_of_scheme ###
       while (my($scheme, $port) = each %default_ports) {
           my $apr_port = APR::URI::port_of_scheme($scheme);
  -        ok t_cmp($port, $apr_port, "scheme: $scheme");
  +        ok t_cmp($apr_port, $port, "scheme: $scheme");
       }
   
       Apache::OK;
  
  
  

Mime
View raw message