summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/typelist.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/typelist.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/typelist.pl')
-rwxr-xr-xsource4/pidl/tests/typelist.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/source4/pidl/tests/typelist.pl b/source4/pidl/tests/typelist.pl
index 5c1a7ddd21..d84fe0592c 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 => 33;
+use Test::More tests => 38;
use FindBin qw($RealBin);
use lib "$RealBin";
use Util;
@@ -22,15 +22,23 @@ is("uint32_t", mapScalarType("uint32"));
is("void", mapScalarType("void"));
is("uint64_t", mapScalarType("hyper"));
-my $x = { TYPE => "ENUM", NAME => "foo" };
+my $x = { TYPE => "ENUM", NAME => "foo", EXTRADATA => 1 };
addType($x);
-is($x, getType("foo"));
+is_deeply($x, getType("foo"));
is(undef, getType("bloebla"));
+is_deeply(getType({ TYPE => "STRUCT" }), { TYPE => "STRUCT" });
+is_deeply(getType({ TYPE => "ENUM", NAME => "foo" }), $x);
+is_deeply(getType("uint16"), {
+ NAME => "uint16",
+ TYPE => "TYPEDEF",
+ DATA => { NAME => "uint16", TYPE => "SCALAR" }});
is(0, typeIs("someUnknownType", "ENUM"));
is(1, hasType("foo"));
is(0, hasType("nonexistant"));
+is(0, hasType({TYPE => "ENUM", NAME => "someUnknownType"}));
+is(1, hasType({TYPE => "ENUM", NAME => "foo"}));
is(1, is_scalar("uint32"));
is(0, is_scalar("nonexistant"));