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/TestAPI conn_rec.pm module.pm query.pm request_rec.pm rutil.pm server_const.pm server_util.pm slurp_filename.pm uri.pm
Date Thu, 08 Jul 2004 05:29:43 GMT
randyk      2004/07/07 22:29:42

  Modified:    t/api    internal_redirect.t rflush.t
               t/response/TestAPI conn_rec.pm module.pm query.pm
                        request_rec.pm rutil.pm server_const.pm
                        server_util.pm slurp_filename.pm uri.pm
  Log:
  swap order of args in t_cmp of t/api tests to use new
  ($received, $expected, $comment) syntax.
  
  Revision  Changes    Path
  1.2       +1 -1      modperl-2.0/t/api/internal_redirect.t
  
  Index: internal_redirect.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/api/internal_redirect.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- internal_redirect.t	15 Oct 2003 00:43:24 -0000	1.1
  +++ internal_redirect.t	8 Jul 2004 05:29:42 -0000	1.2
  @@ -23,5 +23,5 @@
   while (my($key, $val) = each %map) {
       my $expected = "internal redirect: $key";
       my $received = GET_BODY_ASSERT $val;
  -    ok t_cmp($expected, $received);
  +    ok t_cmp($received, $expected);
   }
  
  
  
  1.7       +1 -1      modperl-2.0/t/api/rflush.t
  
  Index: rflush.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/api/rflush.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- rflush.t	23 Aug 2003 16:47:08 -0000	1.6
  +++ rflush.t	8 Jul 2004 05:29:42 -0000	1.7
  @@ -10,4 +10,4 @@
   my $expected = "[<foo][bar>][<who][ah>]";
   my $location = '/TestAPI__rflush';
   my $response = GET_BODY $location;
  -ok t_cmp($expected, $response, "rflush creates bucket brigades");
  +ok t_cmp($response, $expected, "rflush creates bucket brigades");
  
  
  
  1.10      +2 -2      modperl-2.0/t/response/TestAPI/conn_rec.pm
  
  Index: conn_rec.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/conn_rec.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- conn_rec.pm	26 Feb 2004 23:13:04 -0000	1.9
  +++ conn_rec.pm	8 Jul 2004 05:29:42 -0000	1.10
  @@ -43,8 +43,8 @@
   
       ok $c->aborted || 1;
   
  -    ok t_cmp(Apache::CONN_CLOSE,
  -             $c->keepalive,
  +    ok t_cmp($c->keepalive,
  +             Apache::CONN_CLOSE,
                "the client has issued a non-keepalive request");
   
       ok $c->local_ip;
  
  
  
  1.12      +14 -14    modperl-2.0/t/response/TestAPI/module.pm
  
  Index: module.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/module.pm,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- module.pm	7 May 2004 01:47:13 -0000	1.11
  +++ module.pm	8 Jul 2004 05:29:42 -0000	1.12
  @@ -32,12 +32,12 @@
       t_debug "top_module: $top_module_name";
       ok $top_module;
   
  -    ok t_cmp($cfg->{httpd_info}->{MODULE_MAGIC_NUMBER_MAJOR},
  -             $top_module->version,
  +    ok t_cmp($top_module->version,
  +             $cfg->{httpd_info}->{MODULE_MAGIC_NUMBER_MAJOR},
                q{$top_module->version});
   
  -    ok t_cmp(scalar(keys %{ $cfg->{modules} }),
  -             $top_module->module_index,
  +    ok t_cmp($top_module->module_index,
  +             scalar(keys %{ $cfg->{modules} }),
                q{$top_module->module_index})
           || 1; # the A-T config could be wrong
   
  @@ -45,7 +45,7 @@
       #rather than dso.
   
       if ($top_module_name eq 'mod_perl.c') {
  -        ok t_cmp('mod_perl.c', $top_module_name, q{$top_module->name}) || 1;
  +        ok t_cmp($top_module_name, 'mod_perl.c', q{$top_module->name}) || 1;
   
           my $cmd = $top_module->cmds;
   
  @@ -74,39 +74,39 @@
               $modules->{$val} = 1;
           }
   
  -        ok t_cmp($cfg->{modules}, $modules, "Modules list");
  +        ok t_cmp($modules, $cfg->{modules}, "Modules list");
       }
   
       #.c
  -    ok t_cmp(1, Apache::Module::loaded('mod_perl.c'),
  +    ok t_cmp(Apache::Module::loaded('mod_perl.c'), 1,
                "Apache::Module::loaded('mod_perl.c')");
   
  -    ok t_cmp(0, Apache::Module::loaded('Apache__Module_foo.c'),
  +    ok t_cmp(Apache::Module::loaded('Apache__Module_foo.c'), 0,
                "Apache::Module::loaded('Apache__Module_foo.c')");
   
       #.so
       {
           my $build = Apache::BuildConfig->new;
           my $expect = $build->{MODPERL_LIB_SHARED} ? 1 : 0;
  -        ok t_cmp($expect, Apache::Module::loaded('mod_perl.so'),
  +        ok t_cmp(Apache::Module::loaded('mod_perl.so'), $expect,
                    "Apache::Module::loaded('mod_perl.so')");
       }
   
  -    ok t_cmp(0, Apache::Module::loaded('Apache__Module__foo.so'),
  +    ok t_cmp(Apache::Module::loaded('Apache__Module__foo.so'), 0,
                "Apache::Module::loaded('Apache__Module_foo.so')");
   
       #perl
  -    ok t_cmp(1, Apache::Module::loaded('Apache::Module'),
  +    ok t_cmp(Apache::Module::loaded('Apache::Module'), 1,
                "Apache::Module::loaded('Apache::Module')");
   
  -    ok t_cmp(0, Apache::Module::loaded('Apache__Module_foo'),
  +    ok t_cmp(Apache::Module::loaded('Apache__Module_foo'), 0,
                "Apache::Module::loaded('Apache__Module_foo')");
   
       #bogus
  -    ok t_cmp(0, Apache::Module::loaded('Apache__Module_foo.foo'),
  +    ok t_cmp(Apache::Module::loaded('Apache__Module_foo.foo'), 0,
                "Apache::Module::loaded('Apache__Module_foo.foo')");
   
  -    ok t_cmp(0, Apache::Module::loaded(''),
  +    ok t_cmp(Apache::Module::loaded(''), 0,
                "Apache::Module::loaded('')");
   
       Apache::OK;
  
  
  
  1.4       +18 -18    modperl-2.0/t/response/TestAPI/query.pm
  
  Index: query.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/query.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- query.pm	1 Dec 2003 17:55:35 -0000	1.3
  +++ query.pm	8 Jul 2004 05:29:42 -0000	1.4
  @@ -30,8 +30,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_THREADED);
   
  -            ok t_cmp(Apache::MPMQ_NOT_SUPPORTED,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_NOT_SUPPORTED,
                        "MPMQ_IS_THREADED ($mpm)");
   
               # is_threaded() is just a constsub set to the result from
  @@ -48,8 +48,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_FORKED);
   
  -            ok t_cmp(Apache::MPMQ_DYNAMIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_DYNAMIC,
                        "MPMQ_IS_FORKED ($mpm)");
           }
   
  @@ -59,8 +59,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_THREADED);
   
  -            ok t_cmp(Apache::MPMQ_STATIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_STATIC,
                        "MPMQ_IS_THREADED ($mpm)");
   
               ok t_cmp($query,
  @@ -74,8 +74,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_FORKED);
   
  -            ok t_cmp(Apache::MPMQ_DYNAMIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_DYNAMIC,
                        "MPMQ_IS_FORKED ($mpm)");
           }
       }
  @@ -84,8 +84,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_THREADED);
   
  -            ok t_cmp(Apache::MPMQ_STATIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_STATIC,
                        "MPMQ_IS_THREADED ($mpm)");
   
               ok t_cmp($query,
  @@ -99,8 +99,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_FORKED);
   
  -            ok t_cmp(Apache::MPMQ_DYNAMIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_DYNAMIC,
                        "MPMQ_IS_FORKED ($mpm)");
           }
       }
  @@ -109,8 +109,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_THREADED);
   
  -            ok t_cmp(Apache::MPMQ_STATIC,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_STATIC,
                        "MPMQ_IS_THREADED ($mpm)");
   
               ok t_cmp($query,
  @@ -124,8 +124,8 @@
           {
               my $query = Apache::MPM->query(Apache::MPMQ_IS_FORKED);
   
  -            ok t_cmp(Apache::MPMQ_NOT_SUPPORTED,
  -                     $query,
  +            ok t_cmp($query,
  +                     Apache::MPMQ_NOT_SUPPORTED,
                        "MPMQ_IS_FORKED ($mpm)");
           }
       }
  @@ -140,8 +140,8 @@
       {
           my $query = Apache::MPM->query(72);
   
  -        ok t_cmp(undef,
  -                 $query,
  +        ok t_cmp($query,
  +                 undef,
                    "unknown MPMQ value returns undef");
       }
   
  
  
  
  1.19      +3 -3      modperl-2.0/t/response/TestAPI/request_rec.pm
  
  Index: request_rec.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- request_rec.pm	24 May 2004 19:56:51 -0000	1.18
  +++ request_rec.pm	8 Jul 2004 05:29:42 -0000	1.19
  @@ -122,7 +122,7 @@
       ok $r->filename;
   
       my $location = '/' . Apache::TestRequest::module2path(__PACKAGE__);
  -    ok t_cmp($location, $r->location, "location");
  +    ok t_cmp($r->location, $location, "location");
   
       my $mtime = (stat __FILE__)[9];
       $r->mtime($mtime);
  @@ -139,8 +139,8 @@
           $r->finfo($finfo);
           # just one field test, all accessors are fully tested in
           # TestAPR::finfo
  -        ok t_cmp(__FILE__,
  -                 $r->finfo->fname,
  +        ok t_cmp($r->finfo->fname,
  +                 __FILE__,
                    '$r->finfo');
       }
   
  
  
  
  1.16      +2 -2      modperl-2.0/t/response/TestAPI/rutil.pm
  
  Index: rutil.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/rutil.pm,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- rutil.pm	5 Jul 2004 04:00:12 -0000	1.15
  +++ rutil.pm	8 Jul 2004 05:29:42 -0000	1.16
  @@ -41,8 +41,8 @@
                " headers that should always be there");
   
       while (my($code, $line) = each %status_lines) {
  -        ok t_cmp($line,
  -                 Apache::RequestUtil::get_status_line($code),
  +        ok t_cmp(Apache::RequestUtil::get_status_line($code),
  +                 $line,
                    "Apache::RequestUtil::get_status_line($code)");
       }
   
  
  
  
  1.5       +6 -6      modperl-2.0/t/response/TestAPI/server_const.pm
  
  Index: server_const.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_const.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- server_const.pm	2 Jun 2004 02:13:24 -0000	1.4
  +++ server_const.pm	8 Jul 2004 05:29:42 -0000	1.5
  @@ -28,17 +28,17 @@
   
       # test Apache::Server constant subroutines
   
  -    ok t_filepath_cmp(canonpath($root),
  -                      canonpath(Apache::server_root),
  +    ok t_filepath_cmp(canonpath(Apache::server_root),
  +                      canonpath($root),
                         'Apache::server_root()');
        
   
  -    ok t_cmp($built,
  -             Apache::get_server_built,
  +    ok t_cmp(Apache::get_server_built,
  +             $built,
                'Apache::get_server_built()');
   
  -    ok t_cmp($version,
  -             Apache::get_server_version,
  +    ok t_cmp(Apache::get_server_version,
  +             $version,
                'Apache::get_server_version()');
   
       Apache::OK;
  
  
  
  1.20      +8 -8      modperl-2.0/t/response/TestAPI/server_util.pm
  
  Index: server_util.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_util.pm,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- server_util.pm	5 Jul 2004 04:00:12 -0000	1.19
  +++ server_util.pm	8 Jul 2004 05:29:42 -0000	1.20
  @@ -74,17 +74,17 @@
   
       foreach my $p (keys %pools) {
   
  -        ok t_filepath_cmp(catfile($serverroot, 'conf'),
  -                          canonpath(Apache::server_root_relative($pools{$p},
  +        ok t_filepath_cmp(canonpath(Apache::server_root_relative($pools{$p},
                                 'conf')),
  +                          catfile($serverroot, 'conf'),
                             "Apache:::server_root_relative($p, 'conf')");
       }
   
       # dig out the pool from valid objects
       foreach my $obj (keys %objects) {
   
  -        ok t_filepath_cmp(catfile($serverroot, 'conf'),
  -                          canonpath($objects{$obj}->server_root_relative('conf')),
  +        ok t_filepath_cmp(canonpath($objects{$obj}->server_root_relative('conf')),
  +                          catfile($serverroot, 'conf'),
                             "$obj->server_root_relative('conf')");
       }
   
  @@ -99,12 +99,12 @@
       }
   
       # no file argument gives ServerRoot
  -    ok t_filepath_cmp(canonpath($serverroot),
  -                      canonpath($r->server_root_relative),
  +    ok t_filepath_cmp(canonpath($r->server_root_relative),
  +                      canonpath($serverroot),
                         '$r->server_root_relative()');
   
  -    ok t_filepath_cmp(canonpath($serverroot),
  -                      canonpath(Apache::server_root_relative($r->pool)),
  +    ok t_filepath_cmp(canonpath(Apache::server_root_relative($r->pool)),
  +                      canonpath($serverroot),
                         'Apache::server_root_relative($r->pool)');
   
       # Apache::server_root is also the ServerRoot constant
  
  
  
  1.5       +3 -3      modperl-2.0/t/response/TestAPI/slurp_filename.pm
  
  Index: slurp_filename.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/slurp_filename.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- slurp_filename.pm	7 Jul 2004 22:50:06 -0000	1.4
  +++ slurp_filename.pm	8 Jul 2004 05:29:42 -0000	1.5
  @@ -27,7 +27,7 @@
       {
           my $data = $r->slurp_filename(0); # untainted
           my $received = eval $$data;
  -        ok t_cmp($expected, $received, "slurp filename untainted");
  +        ok t_cmp($received, $expected, "slurp filename untainted");
       }
   
       {
  @@ -38,7 +38,7 @@
   
           ModPerl::Util::untaint($$data);
           $received = eval $$data;
  -        ok t_cmp($expected, $received, "slurp filename untainted");
  +        ok t_cmp($received, $expected, "slurp filename untainted");
       }
   
       {
  @@ -51,7 +51,7 @@
   
           ModPerl::Util::untaint($$data);
           $received = eval $$data;
  -        ok t_cmp($expected, $received, "slurp filename (perl) untainted");
  +        ok t_cmp($received, $expected, "slurp filename (perl) untainted");
       }
   
       Apache::OK;
  
  
  
  1.17      +20 -19    modperl-2.0/t/response/TestAPI/uri.pm
  
  Index: uri.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/uri.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- uri.pm	3 Jul 2004 18:45:46 -0000	1.16
  +++ uri.pm	8 Jul 2004 05:29:42 -0000	1.17
  @@ -39,23 +39,23 @@
       # construct_server
       {
           my $server = $r->construct_server;
  -        ok t_cmp($server,
  -                 join(':', $r->get_server_name, $r->get_server_port),
  +        ok t_cmp(join(':', $r->get_server_name, $r->get_server_port),
  +                 $server,
                    "construct_server/get_server_name/get_server_port");
       }
       {
           my $hostname = "example.com";
           my $server = $r->construct_server($hostname);
  -        ok t_cmp($server,
  -                 join(':', $hostname, $r->get_server_port),
  +        ok t_cmp(join(':', $hostname, $r->get_server_port),
  +                 $server,
                    "construct_server($hostname)");
       }
       {
           my $hostname = "example.com";
           my $port     = "9097";
           my $server = $r->construct_server($hostname, $port);
  -        ok t_cmp($server,
  -                 join(':', $hostname, $port),
  +        ok t_cmp(join(':', $hostname, $port),
  +                 $server,
                    "construct_server($hostname, $port)");
   
       }
  @@ -63,8 +63,8 @@
           my $hostname = "example.com";
           my $port     = "9097";
           my $server = $r->construct_server($hostname, $port, $r->pool->new);
  -        ok t_cmp($server,
  -                 join(':', $hostname, $port),
  +        ok t_cmp(join(':', $hostname, $port),
  +                 $server,
                    "construct_server($hostname, $port, new_pool)");
   
       }
  @@ -87,7 +87,7 @@
   
           $parsed->path($path);
   
  -        ok t_cmp($path, $parsed->path, "parsed path");
  +        ok t_cmp($parsed->path, $path, "parsed path");
       }
       {
           # this time include args in the constructed url
  @@ -100,7 +100,7 @@
   
           my $up = $parsed->unparse;
           ok t_cmp($up, qr/$location/, 'construct_url($uri)');
  -        ok t_cmp($r->args,  $parsed->query, "args vs query");
  +        ok t_cmp($parsed->query, $r->args, "args vs query");
       }
       {
           # this time include args and a pool object
  @@ -131,7 +131,7 @@
           # so in order to test pre-0.9.2 and post-0.9.2-dev we massage it
           $expected =~ s|^http:||;
           $received =~ s|^:||;
  -        ok t_cmp($expected, $received,
  +        ok t_cmp($received, $expected,
                    "the bogus url is expected when 'hostname' is set " .
                    "but not 'scheme'");
       }
  @@ -146,23 +146,24 @@
   
           # new request
           $newr->parse_uri($url_string);
  -        ok t_cmp($path, $newr->uri, "uri");
  -        ok t_cmp($query, $newr->args, "args");
  +        ok t_cmp($newr->uri, $path, "uri");
  +        ok t_cmp($newr->args, $query, "args");
   
           my $puri = $newr->parsed_uri;
  -        ok t_cmp($path,     $puri->path,     "path");
  -        ok t_cmp($query,    $puri->query,    "query");
  -        ok t_cmp($fragment, $puri->fragment, "fragment");
  +        ok t_cmp($puri->path,     $path,     "path");
  +        ok t_cmp($puri->query,    $query,    "query");
  +        ok t_cmp($puri->fragment, $fragment, "fragment");
   
           my $port = 6767;
           $puri->port($port);
           $puri->scheme('ftp');
           $puri->hostname('perl.apache.org');
   
  -        ok t_cmp($port, $puri->port, "port");
  +        ok t_cmp($puri->port, $port, "port");
   
  -        ok t_cmp("ftp://perl.apache.org:$port$path?$query#$fragment",
  -                 $puri->unparse, "unparse");
  +        ok t_cmp($puri->unparse,
  +                 "ftp://perl.apache.org:$port$path?$query#$fragment", 
  +                 "unparse");
       }
   
       # unescape_url
  
  
  

Mime
View raw message