From d7a7b7fb0c423c461c24e8157ad926d0cee07da1 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 27 Feb 2007 23:47:07 +0000 Subject: r21572: More work towards supporting tagged types. (This used to be commit 4d28396f0928444406334888f4bc345e74a380df) --- source4/pidl/tests/typelist.pl | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'source4/pidl/tests/typelist.pl') 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")); -- cgit