diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-01-12 23:10:28 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-01-12 23:10:28 +0100 |
commit | ad559581406313741276e39cf0d28b4d3acdaab1 (patch) | |
tree | 07f36c209eabaf022c5008e8e8df62446f5aa073 /source4/pidl/tests | |
parent | 532154af9bebbdf76b2f62ee2b0810e66bc431c7 (diff) | |
download | samba-ad559581406313741276e39cf0d28b4d3acdaab1.tar.gz samba-ad559581406313741276e39cf0d28b4d3acdaab1.tar.bz2 samba-ad559581406313741276e39cf0d28b4d3acdaab1.zip |
pidl: Add function for determining whether a type has a body.
(This used to be commit 893f4102c93c1c2cd6b836f12644d06d9e31800c)
Diffstat (limited to 'source4/pidl/tests')
-rwxr-xr-x | source4/pidl/tests/ndr.pl | 6 | ||||
-rwxr-xr-x | source4/pidl/tests/typelist.pl | 7 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl index 09f1d4969b..ba7fef361b 100755 --- a/source4/pidl/tests/ndr.pl +++ b/source4/pidl/tests/ndr.pl @@ -4,7 +4,7 @@ use strict; use warnings; -use Test::More tests => 37; +use Test::More tests => 39; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -275,3 +275,7 @@ ok(not can_contain_deferred({ TYPE => "TYPEDEF", ELEMENTS => [ { TYPE => "uint32" } ]}})); ok(can_contain_deferred({ TYPE => "STRUCT", ELEMENTS => [ { TYPE => "someunknowntype" } ]})); +# Make sure the elements for a enum without body aren't filled in +ok(not defined(ParseType({TYPE => "ENUM", NAME => "foo" }, "ref")->{ELEMENTS})); +# Make sure the elements for a bitmap without body aren't filled in +ok(not defined(ParseType({TYPE => "BITMAP", NAME => "foo" }, "ref")->{ELEMENTS})); diff --git a/source4/pidl/tests/typelist.pl b/source4/pidl/tests/typelist.pl index 90cb853a52..54f4d34586 100755 --- a/source4/pidl/tests/typelist.pl +++ b/source4/pidl/tests/typelist.pl @@ -4,11 +4,11 @@ use strict; use warnings; -use Test::More tests => 52; +use Test::More tests => 54; use FindBin qw($RealBin); use lib "$RealBin"; use Util; -use Parse::Pidl::Typelist qw(hasType getType mapTypeName expandAlias +use Parse::Pidl::Typelist qw(hasType typeHasBody getType mapTypeName expandAlias mapScalarType addType typeIs is_scalar scalar_is_reference enum_type_fn bitmap_type_fn mapType); @@ -80,3 +80,6 @@ is("uint32_t", mapType({TYPE => "TYPEDEF", DATA => {TYPE => "SCALAR"}}, "uint32" is("void", mapTypeName(undef)); is("uint32_t", mapTypeName("uint32")); is("int32_t", mapTypeName("int")); + +ok(not typeHasBody({TYPE => "TYPEDEF", DATA => { TYPE => "STRUCT" }})); +ok(typeHasBody({TYPE => "TYPEDEF", DATA => { TYPE => "STRUCT", ELEMENTS => [] }})); |