stas 2003/03/20 17:05:54
Modified: t/filter/TestFilter in_str_declined.pm
Log:
fix the test to work with Apache versions that end up splitting the
request body in a different number of bbs, so we can't test the number.
Revision Changes Path
1.4 +5 -3 modperl-2.0/t/filter/TestFilter/in_str_declined.pm
Index: in_str_declined.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/in_str_declined.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- in_str_declined.pm 2 Mar 2003 11:36:15 -0000 1.3
+++ in_str_declined.pm 21 Mar 2003 01:05:53 -0000 1.4
@@ -33,22 +33,24 @@
sub response {
my $r = shift;
- plan $r, tests => 1;
+ plan $r, tests => 2;
$r->content_type('text/plain');
if ($r->method_number == Apache::M_POST) {
# consume the data so the input filter is invoked
my $data = ModPerl::Test::read_post($r);
+ ok t_cmp(20000, length $data, "the request body received ok");
}
# ~20k of input makes it four bucket brigades:
# - 2 full bucket brigades of 8k
# - 1 half full brigade ~4k
# - 1 bucket brigade with EOS bucket
- my $expected = 4;
+ # however different Apache versions may send extra bb or split
+ # data differently so we can't rely on the exact count
my $invoked = $r->notes->get('invoked') || 0;
- ok t_cmp($expected, $invoked, "input stream filter declined");
+ ok $invoked > 1;
Apache::OK;
}