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/ndr.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source4/pidl/tests/ndr.pl') diff --git a/source4/pidl/tests/ndr.pl b/source4/pidl/tests/ndr.pl index 9824d1e815..3be5992ef0 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 => 17; +use Test::More tests => 22; use FindBin qw($RealBin); use lib "$RealBin"; use Util; use Parse::Pidl::Util qw(MyDumper); -use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type); +use Parse::Pidl::NDR qw(GetElementLevelTable ParseElement align_type mapToScalar); # Case 1 @@ -211,3 +211,10 @@ is(align_type({ TYPE => "STRUCT", "NAME" => "bla", ELEMENTS => [ { TYPE => "uint16" } ] }), 4); is(align_type({ TYPE => "STRUCT", "NAME" => "bla", ELEMENTS => [ { TYPE => "uint8" } ] }), 4); + +is(mapToScalar("someverymuchnotexistingtype"), undef); +is(mapToScalar("uint32"), "uint32"); +is(mapToScalar({TYPE => "ENUM", PARENT => { PROPERTIES => { enum8bit => 1 } } }), "uint8"); +is(mapToScalar({TYPE => "BITMAP", PROPERTIES => { bitmap64bit => 1 } }), + "hyper"); +is(mapToScalar({TYPE => "TYPEDEF", DATA => {TYPE => "ENUM", PARENT => { PROPERTIES => { enum8bit => 1 } } }}), "uint8"); -- cgit