summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-25 03:04:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:43 -0500
commit7717f180ca2f908e1b3258355520719991215050 (patch)
treecca55b2debbe63fdf39d6810ad7987af28ffc04a /source4/pidl/lib/Parse/Pidl
parent620d375320e143abcf6775a392f9bde3146f2baa (diff)
downloadsamba-7717f180ca2f908e1b3258355520719991215050.tar.gz
samba-7717f180ca2f908e1b3258355520719991215050.tar.bz2
samba-7717f180ca2f908e1b3258355520719991215050.zip
r12470: Add helper module for pidl tests
Convert other pidl tests to use Test::More and run them from 'make test' (This used to be commit 3a57d29a62112ab654e290ccc985fba7f67664c5)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl')
-rw-r--r--source4/pidl/lib/Parse/Pidl/NDR.pm2
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Header.pm15
2 files changed, 8 insertions, 9 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/NDR.pm b/source4/pidl/lib/Parse/Pidl/NDR.pm
index 4b7a753fa5..e7b790d1e5 100644
--- a/source4/pidl/lib/Parse/Pidl/NDR.pm
+++ b/source4/pidl/lib/Parse/Pidl/NDR.pm
@@ -634,6 +634,8 @@ sub Parse($)
my $idl = shift;
return undef unless (defined($idl));
+
+ Parse::Pidl::NDR::Validate($idl);
my @ndr = ();
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
index a1c568cdc7..46caba731a 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Header.pm
@@ -17,10 +17,7 @@ $VERSION = '0.01';
my($res);
my($tab_depth);
-sub pidl ($)
-{
- $res .= shift;
-}
+sub pidl($) { $res .= shift; }
sub tabs()
{
@@ -261,7 +258,7 @@ sub HeaderFunctionInOut_needed($$)
return undef;
}
-my %headerstructs = ();
+my %headerstructs;
#####################################################################
# parse a function
@@ -313,8 +310,6 @@ sub HeaderInterface($)
{
my($interface) = shift;
- my $count = 0;
-
pidl "#ifndef _HEADER_$interface->{NAME}\n";
pidl "#define _HEADER_$interface->{NAME}\n\n";
@@ -337,6 +332,7 @@ sub HeaderInterface($)
foreach my $d (@{$interface->{DATA}}) {
next if ($d->{TYPE} ne "FUNCTION");
+
HeaderFunction($d);
}
@@ -351,9 +347,10 @@ sub Parse($)
$tab_depth = 0;
$res = "";
+ %headerstructs = ();
pidl "/* header auto-generated by pidl */\n\n";
- foreach my $x (@{$idl}) {
- ($x->{TYPE} eq "INTERFACE") && HeaderInterface($x);
+ foreach (@{$idl}) {
+ ($_->{TYPE} eq "INTERFACE") && HeaderInterface($_);
}
return $res;
}