You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2001/08/07 09:25:41 UTC

t/modules/expires fixup

I've attached a new t/modules/expires.t (and a patch), since it pretty
much rewrites the test so you want to see the new code and not the patch.
I didn't change the flow, but perlify the code and added all the required
checkings, since the test won't work at all for me.

Remember that you have:
use warnings FATAL => 'all';

which means that any emitted warning immediately aborts the test.

I've also changed the indent, again please tell me if I should stop that.

Also please note that you can leave all the debug notes in the test, and
they won't affect the test. But if you want to see the debug notes, just
add -v, e.g.:

% perl t/TEST httpd /home/stas/httpd-2.0/bin/httpd -run -v  t/modules/expires.t

still after rewriting the test, half of the sub-tests fail, because the
'Expires' header is not there.  I did check that I have
in ./t/conf/extra.conf.in:

##
<IfModule mod_expires.c>
<Directory @SERVERROOT@/htdocs/modules/expires>
ExpiresActive On
ExpiresDefault "modification plus 10 years 6 months 2 weeks 3 days 12
hours 30 $ExpiresByType text/plain M60
ExpiresByType image/gif A120
ExpiresByType image/jpeg A86400
</Directory>
</IfModule>


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: Apache/TestConfig.pm patch

Posted by Doug MacEachern <do...@covalent.net>.
On Mon, 13 Aug 2001, Stas Bekman wrote:

> t/TEST -clean
> Use of uninitialized value in string eq at
> Apache-Test/lib/Apache/TestConfig.pm line 775.
> make: *** [test_clean] Error 2

doh!  thanks, i put the fix in using exists.



Apache/TestConfig.pm patch

Posted by Stas Bekman <st...@stason.org>.
t/TEST -clean
Use of uninitialized value in string eq at
Apache-Test/lib/Apache/TestConfig.pm line 775.
make: *** [test_clean] Error 2


here is a possible patch to fix the problem, or probably need to use
exists() for a cleaner way.

Index: Apache-Test/lib/Apache/TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.30
diff -u -r1.30 TestConfig.pm
--- Apache-Test/lib/Apache/TestConfig.pm	2001/08/13 04:08:06
1.30
+++ Apache-Test/lib/Apache/TestConfig.pm	2001/08/13 04:17:52
@@ -772,7 +772,9 @@
     my $thaw = $self->thaw;

     for my $key (@_) {
-        next if $thaw->{vars}->{$key} eq $self->{vars}->{$key};
+        next if $thaw->{vars}->{$key} &&
+            $self->{vars}->{$key} &&
+            $thaw->{vars}->{$key} eq $self->{vars}->{$key};
         $thaw->{vars}->{$key} = $self->{vars}->{$key};
         $changed = 1;
     }




_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/