summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-27 23:47:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:58 -0500
commitd7a7b7fb0c423c461c24e8157ad926d0cee07da1 (patch)
treecf1a2804ca44edd950fe46d5e4b49ed419b9e086 /source4/pidl/tests/ndr.pl
parent3d61a1bbdda98281d8db46b63aa605c794a6af60 (diff)
downloadsamba-d7a7b7fb0c423c461c24e8157ad926d0cee07da1.tar.gz
samba-d7a7b7fb0c423c461c24e8157ad926d0cee07da1.tar.bz2
samba-d7a7b7fb0c423c461c24e8157ad926d0cee07da1.zip
r21572: More work towards supporting tagged types.
(This used to be commit 4d28396f0928444406334888f4bc345e74a380df)
Diffstat (limited to 'source4/pidl/tests/ndr.pl')
-rwxr-xr-xsource4/pidl/tests/ndr.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl
index 26fb6c290b..9824d1e815 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 => 12;
+use Test::More tests => 17;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
use Parse::Pidl::Util qw(MyDumper);
-use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement);
+use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type);
# Case 1
@@ -203,3 +203,11 @@ $e = {
$ne = ParseElement($e, undef);
is($ne->{REPRESENTATION_TYPE}, "uint8");
+
+is(align_type("uint32"), 4);
+is(align_type("uint16"), 2);
+is(align_type("uint8"), 1);
+is(align_type({ TYPE => "STRUCT", "NAME" => "bla",
+ ELEMENTS => [ { TYPE => "uint16" } ] }), 4);
+is(align_type({ TYPE => "STRUCT", "NAME" => "bla",
+ ELEMENTS => [ { TYPE => "uint8" } ] }), 4);