~ubuntu-branches/ubuntu/feisty/libapache2-mod-perl2/feisty-security

« back to all changes in this revision

Viewing changes to ModPerl-Registry/t/cgi-bin/perlrun_nondecl.pl

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2004-08-19 06:23:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040819062348-jxl4koqbtvgm8v2t
Tags: 1.99.14-4
Remove the LFS CFLAGS, and build-dep against apache2-*-dev (>= 2.0.50-10)
as we're backing out of the apache2/apr ABI transition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# we use this file to test how the files w/o package declaration,
 
2
# required from perlrun, work
 
3
 
 
4
use Apache::TestUtil;
 
5
 
 
6
my $num;
 
7
 
 
8
# this BEGIN block is called on every request, since this file gets
 
9
# removed from %INC after it was loaded
 
10
BEGIN {
 
11
    # use an external package which will persist across requests
 
12
    $MyData::blocks{BEGIN}{perlrun_nondecl}++;
 
13
}
 
14
 
 
15
use subs qw(warn_exp);
 
16
 
 
17
# all subs in this file get 'redefined' warning because they are
 
18
# reloaded in the main:: package, which is not under PerlRun's
 
19
# control.
 
20
 
 
21
BEGIN {
 
22
    t_server_log_warn_is_expected()
 
23
        if defined *{"nondecl_no_proto"}{CODE};
 
24
}
 
25
# normal sub, no prototype
 
26
sub nondecl_no_proto        { 1 }
 
27
 
 
28
BEGIN {
 
29
    t_server_log_warn_is_expected()
 
30
        if defined *{"nondecl_proto"}{CODE};
 
31
}
 
32
# sub with a scalar proto
 
33
sub nondecl_proto       ($) { $num = shift }
 
34
 
 
35
BEGIN {
 
36
    t_server_log_warn_is_expected()
 
37
        if defined *{"nondecl_proto_empty"}{CODE};
 
38
}
 
39
# sub with an empty proto, but not a constant
 
40
sub nondecl_proto_empty ()  { $num + 1 }
 
41
 
 
42
# besides the the constant sub will generate two warnings for nondecl_const:
 
43
# - one for main::
 
44
# - another for perlrun's virtual package
 
45
BEGIN {
 
46
    t_server_log_warn_is_expected(2);
 
47
}
 
48
# a constant.
 
49
sub nondecl_const       ()  { 4 }
 
50
 
 
51
END {
 
52
    $MyData::blocks{END}{perlrun_nondecl}++;
 
53
}
 
54
 
 
55
1;