summaryrefslogtreecommitdiff
path: root/source4/pidl/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests')
-rwxr-xr-xsource4/pidl/tests/header.pl8
-rwxr-xr-xsource4/pidl/tests/ndr.pl7
-rwxr-xr-xsource4/pidl/tests/typelist.pl3
3 files changed, 14 insertions, 4 deletions
diff --git a/source4/pidl/tests/header.pl b/source4/pidl/tests/header.pl
index 3dae33ae6c..7092eb0d14 100755
--- a/source4/pidl/tests/header.pl
+++ b/source4/pidl/tests/header.pl
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 10;
+use Test::More tests => 12;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -36,3 +36,9 @@ like(parse_idl("interface x { void foo ([in,out] uint32 x); };"),
like(parse_idl("interface x { void foo (uint32 x); };"), qr/struct foo.*{.*struct\s+{\s+uint32_t x;\s+} in;\s+struct\s+{\s+uint32_t x;\s+} out;.*};/sm, "fn with no props implies in,out");
like(parse_idl("interface p { struct x { int y; }; };"),
qr/struct x.*{.*int32_t y;.*}.*;/sm, "interface member generated properly");
+
+like(parse_idl("interface p { struct x { struct y z; }; };"),
+ qr/struct x.*{.*struct y z;.*}.*;/sm, "tagged type struct member");
+
+like(parse_idl("interface p { struct x { union y z; }; };"),
+ qr/struct x.*{.*union y z;.*}.*;/sm, "tagged type union member");
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index 17003d59c4..8245f768e8 100755
--- a/source4/pidl/tests/ndr.pl
+++ b/source4/pidl/tests/ndr.pl
@@ -4,12 +4,12 @@
use strict;
use warnings;
-use Test::More tests => 25;
+use Test::More tests => 26;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
use Parse::Pidl::Util qw(MyDumper);
-use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type mapToScalar);
+use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type mapToScalar ParseType);
# Case 1
@@ -224,3 +224,6 @@ is(mapToScalar({TYPE => "ENUM", PARENT => { PROPERTIES => { enum8bit => 1 } } })
is(mapToScalar({TYPE => "BITMAP", PROPERTIES => { bitmap64bit => 1 } }),
"hyper");
is(mapToScalar({TYPE => "TYPEDEF", DATA => {TYPE => "ENUM", PARENT => { PROPERTIES => { enum8bit => 1 } } }}), "uint8");
+
+is_deeply(ParseType({TYPE => "STRUCT", NAME => "foo" }, "ref"),
+ {TYPE => "STRUCT", NAME => "foo" });
diff --git a/source4/pidl/tests/typelist.pl b/source4/pidl/tests/typelist.pl
index 376bd208f0..c5c409a525 100755
--- a/source4/pidl/tests/typelist.pl
+++ b/source4/pidl/tests/typelist.pl
@@ -4,7 +4,7 @@
use strict;
use warnings;
-use Test::More tests => 52;
+use Test::More tests => 53;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -60,6 +60,7 @@ is(1, is_scalar({TYPE => "DECLARE", DATA => {TYPE => "ENUM" }}));
is(1, scalar_is_reference("string"));
is(0, scalar_is_reference("uint32"));
+is(0, scalar_is_reference({TYPE => "STRUCT", NAME => "echo_foobar"}));
is("uint8", enum_type_fn({TYPE => "ENUM", PARENT=>{PROPERTIES => {enum8bit => 1}}}));
is("uint32", enum_type_fn({TYPE => "ENUM", PARENT=>{PROPERTIES => {v1_enum => 1}}}));