stas 2003/03/31 20:18:49
Modified: ModPerl-Registry/t 404.t 500.t basic.t redirect.t
ModPerl-Registry/t/cgi-bin closure.pl missing_headers.pl
runtime_error.pl runtime_error_n_status_change.pl
runtime_error_plus_body.pl syntax_error.pl
use_error.pl
Log:
use the newly added t_{client|server}_log_{error|warn}_is_expected()
helper functions to disambiguate expected errors from real ones
Revision Changes Path
1.3 +13 -8 modperl-2.0/ModPerl-Registry/t/404.t
Index: 404.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/404.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- 404.t 7 Feb 2003 00:13:40 -0000 1.2
+++ 404.t 1 Apr 2003 04:18:49 -0000 1.3
@@ -8,13 +8,18 @@
plan tests => 2;
{
- my $url = "/error_document/cannot_be_found";
- my $response = "Oops, can't find the requested doc";
- ok t_cmp(
- $response,
- GET_BODY($url),
- "test ErrorDocument",
- );
+ t_client_log_error_is_expected();
+ my $url = "/error/cannot_be_found";
+ my $res = GET($url);
+ ok t_cmp(404, $res->code, "test 404");
+# t_client_log_error_is_expected();
+# my $url = "/error_document/cannot_be_found";
+# my $response = "Oops, can't find the requested doc";
+# ok t_cmp(
+# $response,
+# GET_BODY($url),
+# "test ErrorDocument"
+# );
}
@@ -24,6 +29,6 @@
ok t_cmp(
404,
$res->code,
- "the script has changed the status to 404",
+ "the script has changed the status to 404"
);
}
1.5 +0 -2 modperl-2.0/ModPerl-Registry/t/500.t
Index: 500.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/500.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- 500.t 1 Apr 2003 03:07:20 -0000 1.4
+++ 500.t 1 Apr 2003 04:18:49 -0000 1.5
@@ -20,8 +20,6 @@
);
}
-
-
{
my $url = "/registry/syntax_error.pl";
my $res = GET($url);
1.14 +1 -0 modperl-2.0/ModPerl-Registry/t/basic.t
Index: basic.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- basic.t 9 Mar 2003 00:16:25 -0000 1.13
+++ basic.t 1 Apr 2003 04:18:49 -0000 1.14
@@ -35,6 +35,7 @@
}
my $url = "/$alias/not_executable.pl";
+ t_client_log_error_is_expected();
ok t_cmp(
"403 Forbidden",
HEAD($url)->status_line(),
1.2 +1 -1 modperl-2.0/ModPerl-Registry/t/redirect.t
Index: redirect.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/redirect.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- redirect.t 16 Aug 2002 10:11:17 -0000 1.1
+++ redirect.t 1 Apr 2003 04:18:49 -0000 1.2
@@ -23,7 +23,7 @@
{
my $redirect_path = "/registry/does_not_exists.pl";
my $url = "$base_url?$redirect_path";
-
+ t_client_log_error_is_expected();
ok t_cmp(
404,
HEAD($url)->code,
1.4 +2 -1 modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl
Index: closure.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/closure.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- closure.pl 16 Aug 2002 10:11:39 -0000 1.3
+++ closure.pl 1 Apr 2003 04:18:49 -0000 1.4
@@ -1,7 +1,8 @@
#!perl -w
BEGIN {
- warn "note: the warning '... will not stay shared' is OK here!!!\n";
+ use Apache::TestUtil;
+ t_server_log_warn_is_expected();
}
# this script will suffer from a closure problem under registry
1.2 +4 -0 modperl-2.0/ModPerl-Registry/t/cgi-bin/missing_headers.pl
Index: missing_headers.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/missing_headers.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- missing_headers.pl 23 Jan 2003 00:33:28 -0000 1.1
+++ missing_headers.pl 1 Apr 2003 04:18:49 -0000 1.2
@@ -1,3 +1,7 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
print "No HTTP headers were sent\n\n";
print "Here is some more body coming\n even with double new line\n\n";
1.3 +5 -0 modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error.pl
Index: runtime_error.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- runtime_error.pl 7 Feb 2003 00:15:39 -0000 1.2
+++ runtime_error.pl 1 Apr 2003 04:18:49 -0000 1.3
@@ -1,3 +1,8 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
+
# this script sends no body at all, and since the error happens
# the script will return 500
1.3 +4 -0
modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl
Index: runtime_error_n_status_change.pl
===================================================================
RCS file:
/home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- runtime_error_n_status_change.pl 7 Feb 2003 00:23:31 -0000 1.2
+++ runtime_error_n_status_change.pl 1 Apr 2003 04:18:49 -0000 1.3
@@ -1,3 +1,7 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
my $r = shift;
$r->status(404);
$r->print("Content-type: text/plain\n\n");
1.2 +5 -0
modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_plus_body.pl
Index: runtime_error_plus_body.pl
===================================================================
RCS file:
/home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_plus_body.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- runtime_error_plus_body.pl 7 Feb 2003 00:15:39 -0000 1.1
+++ runtime_error_plus_body.pl 1 Apr 2003 04:18:49 -0000 1.2
@@ -1,3 +1,8 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
+
# this script sends some body before the error happens,
# so 200 OK is expected, followed by an error
print "Content-type: text/plain\n\n";
1.3 +5 -0 modperl-2.0/ModPerl-Registry/t/cgi-bin/syntax_error.pl
Index: syntax_error.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/syntax_error.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- syntax_error.pl 23 Jan 2003 01:12:01 -0000 1.2
+++ syntax_error.pl 1 Apr 2003 04:18:49 -0000 1.3
@@ -1,3 +1,8 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
+
print "Content-type: text/plain\n\n";
# the following syntax error is here on purpose!
1.2 +5 -0 modperl-2.0/ModPerl-Registry/t/cgi-bin/use_error.pl
Index: use_error.pl
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/use_error.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- use_error.pl 1 Apr 2003 03:07:19 -0000 1.1
+++ use_error.pl 1 Apr 2003 04:18:49 -0000 1.2
@@ -1,3 +1,8 @@
+BEGIN {
+ use Apache::TestUtil;
+ t_server_log_error_is_expected();
+}
+
use DoesNotExist ();
print "Content-type: text/plain\n\n";