summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-09-01 16:54:38 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-09-01 18:22:52 +0200
commit112a1457c05eac6b69395fa04d5d1fdca4a73702 (patch)
treefb022e8f1ae3f4827aa8b039ce94e9ffe4cde432
parentf178b03ba25ce69b2031fa5b9fabbb5c69482ad2 (diff)
downloadperl-112a1457c05eac6b69395fa04d5d1fdca4a73702.tar.gz
Add test for deprecation warnings from h2ph
This makes sure the fix for RT#74404 is working.
-rw-r--r--lib/h2ph.t18
-rw-r--r--t/lib/h2ph.h5
-rw-r--r--t/lib/h2ph.pht4
3 files changed, 19 insertions, 8 deletions
diff --git a/lib/h2ph.t b/lib/h2ph.t
index 8d62d469a9..2b58f6adae 100644
--- a/lib/h2ph.t
+++ b/lib/h2ph.t
@@ -18,7 +18,7 @@ if (!(-e $extracted_program)) {
exit 0;
}
-plan(5);
+plan(6);
# quickly compare two text files
sub txt_compare {
@@ -28,16 +28,18 @@ sub txt_compare {
$A cmp $B;
}
-my $result = runperl( progfile => $extracted_program,
+my $result = runperl( progfile => $extracted_program,
+ stderr => 1,
args => ['-d.', '-Q', 'lib/h2ph.h']);
+is( $result, '', "output is free of warnings" );
is( $?, 0, "$extracted_program runs successfully" );
-
-is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"),
+
+is ( txt_compare("lib/h2ph.ph", "lib/h2ph.pht"),
0,
"generated file has expected contents" );
-
-$result = runperl( progfile => 'lib/h2ph.pht',
- switches => ['-c'],
+
+$result = runperl( progfile => 'lib/h2ph.pht',
+ switches => ['-c'],
stderr => 1 );
like( $result, qr/syntax OK$/, "output compiles");
@@ -46,7 +48,7 @@ $result = runperl( progfile => '_h2ph_pre.ph',
stderr => 1 );
like( $result, qr/syntax OK$/, "preamble compiles");
-$result = runperl( switches => ["-w"],
+$result = runperl( switches => ["-w"],
stderr => 1,
prog => <<'PROG' );
$SIG{__WARN__} = sub { die $_[0] }; require q(lib/h2ph.pht);
diff --git a/t/lib/h2ph.h b/t/lib/h2ph.h
index 78429ca310..802639414b 100644
--- a/t/lib/h2ph.h
+++ b/t/lib/h2ph.h
@@ -132,6 +132,11 @@ enum flimflam {
flam
} flamflim;
+static __inline__ int blli_in_use(struct atm_blli blli)
+{
+ return blli.l2_proto || blli.l3_proto;
+}
+
/* Handle multi-line quoted strings: */
__asm__ __volatile__("
this
diff --git a/t/lib/h2ph.pht b/t/lib/h2ph.pht
index cda8d21051..f068d6dae4 100644
--- a/t/lib/h2ph.pht
+++ b/t/lib/h2ph.pht
@@ -90,6 +90,10 @@ unless(defined(&_H2PH_H_)) {
}
eval("sub flim () { 0; }") unless defined(&flim);
eval("sub flam () { 1; }") unless defined(&flam);
+ eval 'sub blli_in_use {
+ my($blli) = @_;
+ eval q({ ($blli->{l2_proto}) || ($blli->{l3_proto}); });
+ }' unless defined(&blli_in_use);
eval 'sub multiline () {"multilinestring";}' unless defined(&multiline);
}
1;