summaryrefslogtreecommitdiff
path: root/source4/pidl/tests
diff options
context:
space:
mode:
Diffstat (limited to 'source4/pidl/tests')
-rwxr-xr-xsource4/pidl/tests/ndr.pl4
-rwxr-xr-xsource4/pidl/tests/parse_idl.pl11
2 files changed, 13 insertions, 2 deletions
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index ba7fef361b..7fcc7ef40e 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 => 39;
+use Test::More tests => 40;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -279,3 +279,5 @@ ok(can_contain_deferred({ TYPE => "STRUCT",
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}));
+# Make sure the elements for a union without body aren't filled in
+ok(not defined(ParseType({TYPE => "UNION", NAME => "foo" }, "ref")->{ELEMENTS}));
diff --git a/source4/pidl/tests/parse_idl.pl b/source4/pidl/tests/parse_idl.pl
index 93f772ef41..9d43ddccc7 100755
--- a/source4/pidl/tests/parse_idl.pl
+++ b/source4/pidl/tests/parse_idl.pl
@@ -4,7 +4,7 @@
# Published under the GNU General Public License
use strict;
-use Test::More tests => 65 * 2 + 6;
+use Test::More tests => 65 * 2 + 7;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util qw(test_errors);
@@ -153,3 +153,12 @@ is_deeply($x,
[ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
{ 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => { TYPE => 'BITMAP', NAME => 'x' } } ],
'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);
+
+
+# A typedef of a union with no body
+$x = Parse::Pidl::IDL::parse_string("interface foo { typedef union x y; }", "<foo>");
+
+is_deeply($x,
+ [ { 'FILE' => '<foo>', 'NAME' => 'foo', 'DATA' => [
+ { 'FILE' => '<foo>', 'LINE' => 0, 'NAME' => 'y', 'TYPE' => 'TYPEDEF', DATA => { TYPE => 'UNION', NAME => 'x' } } ],
+ 'TYPE' => 'INTERFACE', 'LINE' => 0 } ]);