summaryrefslogtreecommitdiff
path: root/source4/pidl/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests')
-rw-r--r--source4/pidl/tests/Util.pm12
-rwxr-xr-xsource4/pidl/tests/util.pl1
2 files changed, 11 insertions, 2 deletions
diff --git a/source4/pidl/tests/Util.pm b/source4/pidl/tests/Util.pm
index 2f43abe1ed..cfa1422674 100644
--- a/source4/pidl/tests/Util.pm
+++ b/source4/pidl/tests/Util.pm
@@ -18,14 +18,22 @@ my $warnings = "";
undef &Parse::Pidl::warning;
*Parse::Pidl::warning = sub {
my ($e, $l) = @_;
- $warnings .= "$e->{FILE}:$e->{LINE}: $l\n";
+ if (defined($e)) {
+ $warnings .= "$e->{FILE}:$e->{LINE}: $l\n";
+ } else {
+ $warnings .= "$l\n";
+ }
};
my $errors = "";
undef &Parse::Pidl::error;
*Parse::Pidl::error = sub {
my ($e, $l) = @_;
- $errors .= "$e->{FILE}:$e->{LINE}: $l\n";
+ if (defined($e)) {
+ $errors .= "$e->{FILE}:$e->{LINE}: $l\n";
+ } else {
+ $errors .= "$l\n";
+ }
};
use Test::More;
diff --git a/source4/pidl/tests/util.pl b/source4/pidl/tests/util.pl
index cea59af1b6..19cb90c080 100755
--- a/source4/pidl/tests/util.pl
+++ b/source4/pidl/tests/util.pl
@@ -2,6 +2,7 @@
# (C) 2007 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU General Public License
use strict;
+use warnings;
use Test::More tests => 56;
use FindBin qw($RealBin);