stas 2004/05/30 22:51:14
Modified: . Changes
t/filter/TestFilter out_str_api.pm
xs/maps apache_structures.map
Log:
- Apache::FilterRec:
- remove the next() accessor since it's not used by Apache at the
moment
- name() is made read-only
- improve the test
Revision Changes Path
1.382 +5 -0 modperl-2.0/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/modperl-2.0/Changes,v
retrieving revision 1.381
retrieving revision 1.382
diff -u -u -r1.381 -r1.382
--- Changes 28 May 2004 01:36:40 -0000 1.381
+++ Changes 31 May 2004 05:51:14 -0000 1.382
@@ -12,6 +12,11 @@
=item 1.99_15-dev
+Apache::FilterRec: [Stas]
+ - remove the next() accessor since it's not used by Apache at the
+ moment
+ - name() is made read-only
+
APR::URI: [Stas]
- removed accessors
o is_initialized() (internal apr_uri flag)
1.5 +34 -9 modperl-2.0/t/filter/TestFilter/out_str_api.pm
Index: out_str_api.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/out_str_api.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -u -r1.4 -r1.5
--- out_str_api.pm 24 Apr 2003 04:26:40 -0000 1.4
+++ out_str_api.pm 31 May 2004 05:51:14 -0000 1.5
@@ -1,5 +1,7 @@
package TestFilter::out_str_api;
+# Test Apache::FilterRec and Apache::Filter accessors
+
use strict;
use warnings FATAL => 'all';
@@ -9,6 +11,7 @@
use Apache::FilterRec ();
use Apache::Test;
+use Apache::TestUtil;
use Apache::TestRequest;
use Apache::Const -compile => 'OK';
@@ -30,24 +33,36 @@
tie *STDOUT, $filter;
- plan tests => 6;
+ plan tests => 8;
- ok $data eq $response_data;
+ ok t_cmp($response_data, $data, "response data");
ok $filter->isa('Apache::Filter');
- my $frec = $filter->frec;
+ {
+ my $frec = $filter->frec;
- ok $frec->isa('Apache::FilterRec');
+ ok $frec->isa('Apache::FilterRec');
+ ok t_cmp("modperl_request_output", $frec->name, '$frec->name');
- ok $frec->name;
+ my $next = $filter->next;
+ ok t_cmp("modperl_request_output",
+ $next->frec->name, '$filter->next->frec->name');
+
+ $next = $next->next;
+ # since we can't ensure that the next filter will be the same,
+ # as it's not under control, just check that we get some name
+ my $name = $next->frec->name;
+ t_debug("next->next name: $name");
+ ok $name;
+ }
my $r = $filter->r;
ok $r->isa('Apache::RequestRec');
my $path = '/' . Apache::TestRequest::module2path(__PACKAGE__);
- ok $r->uri eq $path;
+ ok t_cmp($path, $r->uri, "path");
untie *STDOUT;
@@ -57,6 +72,10 @@
Apache::OK;
}
+sub pass_through {
+ return Apache::DECLINED;
+}
+
sub response {
my $r = shift;
@@ -68,6 +87,12 @@
1;
__DATA__
-SetHandler modperl
-PerlModule TestFilter::out_str_api
-PerlResponseHandler TestFilter::out_str_api::response
+<NoAutoConfig>
+PerlModule TestFilter::out_str_api
+<Location /TestFilter__out_str_api>
+ SetHandler modperl
+ PerlResponseHandler TestFilter::out_str_api::response
+ PerlOutputFilterHandler TestFilter::out_str_api
+ PerlOutputFilterHandler TestFilter::out_str_api::pass_through
+</Location>
+</NoAutoConfig>
1.25 +2 -2 modperl-2.0/xs/maps/apache_structures.map
Index: apache_structures.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/apache_structures.map,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -u -r1.24 -r1.25
--- apache_structures.map 28 May 2004 01:35:38 -0000 1.24
+++ apache_structures.map 31 May 2004 05:51:14 -0000 1.25
@@ -165,10 +165,10 @@
</command_rec>
<ap_filter_rec_t>
- name
+< name
- filter_func
! ftype
- next
+- next
</ap_filter_rec_t>
<ap_filter_t>