summaryrefslogtreecommitdiff
path: root/source4/pidl/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-21 10:31:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:41 -0500
commit90789cb08b84d3b916df3ed11fa9c68dd3075600 (patch)
tree2019a692662d5748079a92dab4db72bd936a3099 /source4/pidl/tests
parent9f420a6c6d10f76e923881e768ed42eb918e2d52 (diff)
downloadsamba-90789cb08b84d3b916df3ed11fa9c68dd3075600.tar.gz
samba-90789cb08b84d3b916df3ed11fa9c68dd3075600.tar.bz2
samba-90789cb08b84d3b916df3ed11fa9c68dd3075600.zip
r21484: Fix Needed* for nested datastructures.
(This used to be commit ec3c9ebfd0de287411ce399967409f902653d5c6)
Diffstat (limited to 'source4/pidl/tests')
-rwxr-xr-xsource4/pidl/tests/samba-ndr.pl38
1 files changed, 22 insertions, 16 deletions
diff --git a/source4/pidl/tests/samba-ndr.pl b/source4/pidl/tests/samba-ndr.pl
index 1167f77aee..d956402e64 100755
--- a/source4/pidl/tests/samba-ndr.pl
+++ b/source4/pidl/tests/samba-ndr.pl
@@ -11,7 +11,8 @@ use Util;
use Parse::Pidl::Util qw(MyDumper);
use Parse::Pidl::Samba4::NDR::Parser qw(check_null_pointer
GenerateFunctionInEnv GenerateFunctionOutEnv GenerateStructEnv
- EnvSubstituteValue NeededFunction NeededElement NeededType $res);
+ EnvSubstituteValue NeededFunction NeededElement NeededType $res
+ NeededInterface);
my $output;
sub print_fn($) { my $x = shift; $output.=$x; }
@@ -209,46 +210,51 @@ is_deeply($needed, { pull_foo => 1, print_foo => 1, push_foo => 1,
# public structs are always needed
$needed = {};
-NeededType({ NAME => "bla", DATA => { TYPE => "STRUCT", ELEMENTS => [] } },
- $needed);
+NeededType({ NAME => "bla", TYPE => "TYPEDEF",
+ DATA => { TYPE => "STRUCT", ELEMENTS => [] } },
+ $needed, "pull");
is_deeply($needed, { });
$needed = {};
-NeededType({ PROPERTIES => { public => 1 }, NAME => "bla",
- DATA => { TYPE => "STRUCT", ELEMENTS => [] } },
+NeededInterface({ TYPES => [ { PROPERTIES => { public => 1 }, NAME => "bla",
+ TYPE => "TYPEDEF",
+ DATA => { TYPE => "STRUCT", ELEMENTS => [] } } ] },
$needed);
-is_deeply($needed, { pull_bla => 1, print_bla => 1, push_bla => 1 });
+is_deeply($needed, { pull_bla => 1, push_bla => 1, print_bla => 1 });
# make sure types for elements are set too
$needed = {};
-NeededType({ PROPERTIES => { public => 1 }, NAME => "bla",
+NeededInterface({ TYPES => [ { PROPERTIES => { public => 1 }, NAME => "bla",
+ TYPE => "TYPEDEF",
DATA => { TYPE => "STRUCT",
- ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "bar" } ] } },
+ ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "bar" } ] } } ] },
$needed);
-is_deeply($needed, { pull_bla => 1, print_bla => 1, push_bla => 1,
- pull_bar => 1, print_bar => 1, push_bar => 1});
+is_deeply($needed, { pull_bla => 1, pull_bar => 1, push_bla => 1, push_bar => 1,
+ print_bla => 1, print_bar => 1});
$needed = {};
-NeededType({ PROPERTIES => { gensize => 1}, NAME => "bla",
+NeededInterface({ TYPES => [ { PROPERTIES => { gensize => 1}, NAME => "bla",
+ TYPE => "TYPEDEF",
DATA => { TYPE => "STRUCT",
- ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "bar" } ] } },
+ ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "bar" } ] } } ] },
$needed);
is_deeply($needed, { ndr_size_bla => 1 });
# make sure types for elements are set too
$needed = { pull_bla => 1 };
NeededType({ NAME => "bla",
+ TYPE => "TYPEDEF",
DATA => { TYPE => "STRUCT",
ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "bar" } ] } },
- $needed);
+ $needed, "pull");
is_deeply($needed, { pull_bla => 1, pull_bar => 1 });
$needed = {};
-NeededType({ PROPERTIES => { public => 1},
+NeededInterface({ TYPES => [ { PROPERTIES => { public => 1},
NAME => "bla",
+ TYPE => "TYPEDEF",
DATA => { TYPE => "STRUCT",
- ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "rep" } ] } },
- $needed);
+ ELEMENTS => [ { TYPE => "bar", REPRESENTATION_TYPE => "rep" } ] } } ] }, $needed);
is_deeply($needed, { pull_bla => 1, push_bla => 1, print_bla => 1, print_rep => 1,
pull_bar => 1, push_bar => 1,
ndr_bar_to_rep => 1, ndr_rep_to_bar => 1});