From c1aef15fe7e7a7558b6ede11babc1932263814e6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Feb 2007 00:19:57 +0000 Subject: r21573: Remove more code that assumed all types are typedefs. (This used to be commit bbbfbfa870c44a6148c3d4d47ff409098e85fcc3) --- source4/pidl/tests/typelist.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source4/pidl/tests/typelist.pl') diff --git a/source4/pidl/tests/typelist.pl b/source4/pidl/tests/typelist.pl index d84fe0592c..e538cb2e0d 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 => 38; +use Test::More tests => 50; use FindBin qw($RealBin); use lib "$RealBin"; use Util; @@ -34,14 +34,27 @@ is_deeply(getType("uint16"), { DATA => { NAME => "uint16", TYPE => "SCALAR" }}); is(0, typeIs("someUnknownType", "ENUM")); +is(0, typeIs("foo", "ENUM")); +addType({NAME => "mytypedef", TYPE => "TYPEDEF", DATA => { TYPE => "ENUM" }}); +is(1, typeIs("mytypedef", "ENUM")); +is(0, typeIs("mytypedef", "BITMAP")); +is(1, typeIs({ TYPE => "ENUM"}, "ENUM")); +is(0, typeIs({ TYPE => "BITMAP"}, "ENUM")); +is(1, typeIs("uint32", "SCALAR")); +is(0, typeIs("uint32", "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, hasType({TYPE => "ENUM"})); +is(1, hasType({TYPE => "STRUCT"})); is(1, is_scalar("uint32")); is(0, is_scalar("nonexistant")); +is(1, is_scalar({TYPE => "ENUM"})); +is(0, is_scalar({TYPE => "STRUCT"})); +is(1, is_scalar({TYPE => "TYPEDEF", DATA => {TYPE => "ENUM" }})); is(1, scalar_is_reference("string")); is(0, scalar_is_reference("uint32")); -- cgit