summaryrefslogtreecommitdiff
path: root/source4/pidl/idl.yp
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-24 23:32:50 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:42 -0500
commit68ef82aac72c351f6e166b92bbb4573e8bcdbc86 (patch)
treeb4a7b5518eb5f525f17990b240f121a62283ec29 /source4/pidl/idl.yp
parentebfbb2a7abe33e47af48d69164c37f4c24b7f8ed (diff)
downloadsamba-68ef82aac72c351f6e166b92bbb4573e8bcdbc86.tar.gz
samba-68ef82aac72c351f6e166b92bbb4573e8bcdbc86.tar.bz2
samba-68ef82aac72c351f6e166b92bbb4573e8bcdbc86.zip
r12464: Add simple IDL parsing tests for pidl using the standard perl
testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' (This used to be commit 975d8816db6697dab828941b69a740e3a0a2c272)
Diffstat (limited to 'source4/pidl/idl.yp')
-rw-r--r--source4/pidl/idl.yp8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/pidl/idl.yp b/source4/pidl/idl.yp
index ef0ec203a7..430f7e1b06 100644
--- a/source4/pidl/idl.yp
+++ b/source4/pidl/idl.yp
@@ -330,6 +330,7 @@ sub CleanData($)
{
sub CleanData($);
my($v) = shift;
+ return undef if (not defined($v));
if (ref($v) eq "ARRAY") {
foreach my $i (0 .. $#{$v}) {
CleanData($v->[$i]);
@@ -416,12 +417,13 @@ again:
}
}
-sub parse_string($)
+sub parse_string
{
- my ($data) = @_;
+ my ($data,$filename) = @_;
my $self = new Parse::Pidl::IDL;
+ $self->YYData->{INPUT_FILENAME} = $filename;
$self->YYData->{INPUT} = $data;
$self->YYData->{LINE} = 0;
$self->YYData->{LAST_TOKEN} = "NONE";
@@ -444,5 +446,5 @@ sub parse_file($)
my $data = `$cpp -D__PIDL__ -xc $filename`;
$/ = $saved_delim;
- return parse_string($data);
+ return parse_string($data, $filename);
}