summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/Util.pm
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests/Util.pm')
-rw-r--r--source4/pidl/tests/Util.pm12
1 files changed, 10 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;