randyk      2003/11/18 09:07:46

  Modified:    t/response/TestAPR finfo.pm
  Log:
  Reviewed by:  geoff
  
  skip certain tests on Win32 due to different file semantics.
  
  Revision  Changes    Path
  1.2       +23 -8     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- finfo.pm  17 Nov 2003 23:31:02 -0000      1.1
  +++ finfo.pm  18 Nov 2003 17:07:46 -0000      1.2
  @@ -6,6 +6,8 @@
   use Apache::Test;
   use Apache::TestUtil;
   use Apache::TestTrace;
  +use Apache::TestConfig;
  +use constant WIN32 => Apache::TestConfig::WIN32;
   
   use Apache::RequestRec ();
   use APR::Finfo ();
  @@ -54,15 +56,23 @@
           our ($device, $inode, $protection, $nlink, $user, $group,
                undef, $size, $atime, $mtime, $ctime) = stat $file;
   
  +        # skip certain tests on Win32 (and others?)
  +        my %skip =  WIN32 ?
  +            (map {$_ => 1} qw(device inode user group) ) : ();
  +
           # compare stat fields between perl and apr_stat
           {
               no strict qw(refs);
               foreach my $method (qw(device inode nlink user group
                                      size atime mtime ctime)) {
  -
  -                ok t_cmp(${$method},
  -                         $r->finfo->$method(),
  -                         "\$r->finfo->$method()");
  +                if ($skip{$method}) {
  +                    skip "different file semantics";
  +                }
  +                else {
  +                    ok t_cmp(${$method},
  +                             $r->finfo->$method(),
  +                             "\$r->finfo->$method()");
  +                }
               }
           }
   
  @@ -76,9 +86,14 @@
                    $r->finfo->protection & APR::WWRITE,
                    '$r->finfo->protection() & APR::WWRITE');
   
  -        ok t_cmp($protection & S_IXOTH,
  -                 $r->finfo->protection & APR::WEXECUTE,
  -                 '$r->finfo->protection() & APR::WEXECUTE');
  +        if (WIN32) {
  +            skip "different file semantics";
  +        }
  +        else {
  +            ok t_cmp($protection & S_IXOTH,
  +                     $r->finfo->protection & APR::WEXECUTE,
  +                     '$r->finfo->protection() & APR::WEXECUTE');
  +        }
       }
   
       # tests for stuff not in perl's stat
  @@ -90,7 +105,7 @@
           ok t_cmp(APR::REG,
                    $r->finfo->filetype,
                    '$r->finfo->filetype()');
  -    }        
  +    }
   
       Apache::OK;
   }
  
  
  

Reply via email to