summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr.pl
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-08-16 14:42:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:02:01 -0500
commit575c8709262bb97ef1b14d128058620a9200e447 (patch)
treeddd0d5743c05a9718453a93c481d455af69f7276 /source4/pidl/tests/ndr.pl
parentb76b6a15225329941c20070d05356aba56044173 (diff)
downloadsamba-575c8709262bb97ef1b14d128058620a9200e447.tar.gz
samba-575c8709262bb97ef1b14d128058620a9200e447.tar.bz2
samba-575c8709262bb97ef1b14d128058620a9200e447.zip
r24493: - it turns out that
foreach my $e (@{$union->{ELEMENTS}}) { changes $union->{ELEMENTS} from undef into an empty array. this removes the difference between struct foo { }; and struct foo; So we need to explicit return before. - we should return the same element for layout for structs and unions with no elements. - fix the testsuite to match metze (This used to be commit 5f1f50cd27e3702b79a19dbe1079498cbfc4842b)
Diffstat (limited to 'source4/pidl/tests/ndr.pl')
-rwxr-xr-xsource4/pidl/tests/ndr.pl32
1 files changed, 29 insertions, 3 deletions
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index 8245f768e8..043d2b9905 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 => 26;
+use Test::More tests => 27;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -225,5 +225,31 @@ 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" });
+my $t;
+$t = {
+ TYPE => "STRUCT",
+ NAME => "foo",
+ SURROUNDING_ELEMENT => undef,
+ ELEMENTS => undef,
+ PROPERTIES => undef,
+ ORIGINAL => {
+ TYPE => "STRUCT",
+ NAME => "foo"
+ },
+ ALIGN => undef
+};
+is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t);
+
+$t = {
+ TYPE => "UNION",
+ NAME => "foo",
+ SWITCH_TYPE => "uint32",
+ ELEMENTS => undef,
+ PROPERTIES => undef,
+ HAS_DEFAULT => 0,
+ ORIGINAL => {
+ TYPE => "UNION",
+ NAME => "foo"
+ }
+};
+is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t);