svn commit: samba r21437 - in branches/SAMBA_4_0: . source/pidl/lib/Parse/Pidl source/pidl/tests

jelmer at samba.org jelmer at samba.org
Sun Feb 18 23:48:17 GMT 2007


Author: jelmer
Date: 2007-02-18 23:48:16 +0000 (Sun, 18 Feb 2007)
New Revision: 21437

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21437

Log:
Cherrypick typelib tests.
Added:
   branches/SAMBA_4_0/source/pidl/tests/typelist.pl
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Typelist.pm


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq
jelmer at samba.org-20070215210330-ve8q1mdkjymv6fr1
jelmer at samba.org-20070215220450-avh0rwc0ce0x7gja
jelmer at samba.org-20070215225539-cy8w0815ygz1wa0c
jelmer at samba.org-20070215234924-5u8bqtdp3ha66015
jelmer at samba.org-20070216003036-0ghop153wj46jjwe
jelmer at samba.org-20070216010504-03udexhmrhje5w5c
jelmer at samba.org-20070216124407-uwk21820sjr6n46p
jelmer at samba.org-20070216141029-nf84hlj2tr39ealw
jelmer at samba.org-20070216151123-m8lw5r1ebhymw8ba
jelmer at samba.org-20070217013108-znc8d1w6rtx0kaqf
jelmer at samba.org-20070217135603-92hi5qaxrxwoqulu
jelmer at samba.org-20070217233534-x58078kx0zci6831
jelmer at samba.org-20070218003055-80z3rswwe279yelu
jelmer at samba.org-20070218003815-07xijfqrcx3tybfi
jelmer at samba.org-20070218010222-fe4oase328jeg840
jelmer at samba.org-20070218115359-jytly04u0aufe8vn
jelmer at samba.org-20070218115806-9h8thqvb95iffgh5
jelmer at samba.org-20070218120236-9q5wvlctgevr438d
jelmer at samba.org-20070218120857-cg7f6ppc1b3jd2nj
jelmer at samba.org-20070218122007-5c147i8tk17nh31s
jelmer at samba.org-20070218125126-mq0gsnn6mdt0dr5p
jelmer at samba.org-20070218133855-zz8l3b16rc7rh5n9
jelmer at samba.org-20070218134908-r7jzuwppx6odzgao
jelmer at samba.org-20070218161231-qs4bbg2mkz3lo6rf
jelmer at samba.org-20070218164355-wcsqzlh7s37se8xk
jelmer at samba.org-20070218165112-edgr3gi0gg7aaqlj
jelmer at samba.org-20070218183655-2qk7xgjc222tls7y

   + jelmer at samba.org-20060824212938-5923465160f6ab63
jelmer at samba.org-20060830112659-186f132eebc987cc
jelmer at samba.org-20060904121718-63b73248146c14f8
jelmer at samba.org-20060904124721-5e70ab0bd405f748
metze at samba.org-20061010151401-45a5a2ed52cfe172
jelmer at samba.org-20061016130323-400ce51ee51ab30e
jelmer at samba.org-20061016195822-c7783d3ea1a56a53
jelmer at samba.org-20061016230421-75bca2ad62945ede
jelmer at samba.org-20061017145110-8c83a3dd979f6a6a
jelmer at samba.org-20061029173623-eb0459f1d3eb5720
jelmer at samba.org-20070115022006-h5ef1deqflt940b6
jelmer at samba.org-20070116142934-hv99dpwbnq2znh8f
jelmer at samba.org-20070116144126-70rip3bppmvgs3t6
jelmer at samba.org-20070116151516-imvui4r33cj850j9
jelmer at samba.org-20070116154739-3tji4fft7964qgrj
jelmer at samba.org-20070116173900-iasa25stcfty6pbr
jelmer at samba.org-20070117144550-te3o0iy10y14iyo4
jelmer at samba.org-20070122000024-q911packyrjk69ud
jelmer at samba.org-20070122181120-3n8ah238pjbzylyo
jelmer at samba.org-20070122182054-6b26fqrdqyjhyeuc
jelmer at samba.org-20070122233549-k085tfo2o1eqz7mm
jelmer at samba.org-20070123002251-0smz35eva10x84tc
jelmer at samba.org-20070123003546-p0jl6j9tw79q5j1k
jelmer at samba.org-20070123012404-o9w5pmgkm94zsxlu
jelmer at samba.org-20070123094731-ns7dzzzqtb0dlcod
jelmer at samba.org-20070125123431-g3pqm92r31ez9xyc
jelmer at samba.org-20070126125959-3w3t26aps9hmwukv
jelmer at samba.org-20070126132607-64kt7rc2wtqh0c7u
jelmer at samba.org-20070126133903-onfotbg1051ktojo
jelmer at samba.org-20070126144259-171b4t0744jigs5x
jelmer at samba.org-20070126152205-xj7j1avc7683rjy5
jelmer at samba.org-20070128010235-e8st47gcy00ii8kc
jelmer at samba.org-20070128130853-xjjrlrtf830pwnx6
jelmer at samba.org-20070130120806-gfqshokma9j6j3uv
jelmer at samba.org-20070131002510-55yxynmb1o4zvx0x
jelmer at samba.org-20070131115042-oocen3olfgu53jlm
jelmer at samba.org-20070206235608-980jutwyp43708k6
jelmer at samba.org-20070207185718-i1xx6bvmdeeii72p
jelmer at samba.org-20070208234639-i0h5mfefbn1a1lkl
jelmer at samba.org-20070209001154-lol5huzwdq9jw2e7
jelmer at samba.org-20070209093351-buzkh0t55nt863gw
jelmer at samba.org-20070212120516-lwfxtpxx1lerwro2
jelmer at samba.org-20070212130037-e7t2bh0ufajvi8m6
jelmer at samba.org-20070212173050-hpr37tn9ws2zhfko
jelmer at samba.org-20070214123932-nmsy6lnin8gtzxrn
jelmer at samba.org-20070214141810-0df8ykq1d0dl6yia
jelmer at samba.org-20070214143534-pc63vqrp827s6sdo
jelmer at samba.org-20070214145213-idzserezbwc2alty
jelmer at samba.org-20070214150805-zjdhqbtwy28fac3c
jelmer at samba.org-20070214192135-0yxxt5pto2lv4p4h
jelmer at samba.org-20070214213108-id4l0x9g95v6i060
jelmer at samba.org-20070215192824-a13ptx6qq150shoq
jelmer at samba.org-20070215210330-ve8q1mdkjymv6fr1
jelmer at samba.org-20070215220450-avh0rwc0ce0x7gja
jelmer at samba.org-20070215225539-cy8w0815ygz1wa0c
jelmer at samba.org-20070215234924-5u8bqtdp3ha66015
jelmer at samba.org-20070216003036-0ghop153wj46jjwe
jelmer at samba.org-20070216010504-03udexhmrhje5w5c
jelmer at samba.org-20070216124407-uwk21820sjr6n46p
jelmer at samba.org-20070216141029-nf84hlj2tr39ealw
jelmer at samba.org-20070216151123-m8lw5r1ebhymw8ba
jelmer at samba.org-20070217013108-znc8d1w6rtx0kaqf
jelmer at samba.org-20070217135603-92hi5qaxrxwoqulu
jelmer at samba.org-20070217233534-x58078kx0zci6831
jelmer at samba.org-20070218003055-80z3rswwe279yelu
jelmer at samba.org-20070218003815-07xijfqrcx3tybfi
jelmer at samba.org-20070218010222-fe4oase328jeg840
jelmer at samba.org-20070218115359-jytly04u0aufe8vn
jelmer at samba.org-20070218115806-9h8thqvb95iffgh5
jelmer at samba.org-20070218120236-9q5wvlctgevr438d
jelmer at samba.org-20070218120857-cg7f6ppc1b3jd2nj
jelmer at samba.org-20070218122007-5c147i8tk17nh31s
jelmer at samba.org-20070218125126-mq0gsnn6mdt0dr5p
jelmer at samba.org-20070218133855-zz8l3b16rc7rh5n9
jelmer at samba.org-20070218134908-r7jzuwppx6odzgao
jelmer at samba.org-20070218161231-qs4bbg2mkz3lo6rf
jelmer at samba.org-20070218164355-wcsqzlh7s37se8xk
jelmer at samba.org-20070218165112-edgr3gi0gg7aaqlj
jelmer at samba.org-20070218183655-2qk7xgjc222tls7y
jelmer at samba.org-20070218234351-nxjnkhl4bc4x00df


Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Typelist.pm
===================================================================
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Typelist.pm	2007-02-18 23:27:42 UTC (rev 21436)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Typelist.pm	2007-02-18 23:48:16 UTC (rev 21437)
@@ -7,7 +7,10 @@
 
 require Exporter;
 @ISA = qw(Exporter);
- at EXPORT_OK = qw(hasType getType mapTypeName scalar_is_reference expandAlias);
+ at EXPORT_OK = qw(hasType getType mapTypeName scalar_is_reference expandAlias
+			    mapScalarType addType typeIs is_scalar enum_type_fn
+				bitmap_type_fn mapType
+);
 use vars qw($VERSION);
 $VERSION = '0.01';
 

Added: branches/SAMBA_4_0/source/pidl/tests/typelist.pl
===================================================================
--- branches/SAMBA_4_0/source/pidl/tests/typelist.pl	2007-02-18 23:27:42 UTC (rev 21436)
+++ branches/SAMBA_4_0/source/pidl/tests/typelist.pl	2007-02-18 23:48:16 UTC (rev 21437)
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+# (C) 2007 Jelmer Vernooij <jelmer at samba.org>
+# Published under the GNU General Public License
+use strict;
+use warnings;
+
+use Test::More tests => 33;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Typelist qw(hasType getType mapTypeName expandAlias
+	mapScalarType addType typeIs is_scalar scalar_is_reference
+	enum_type_fn bitmap_type_fn mapType);
+
+is("foo", expandAlias("foo"));
+is("uint32", expandAlias("DWORD"));
+is("int32", expandAlias("int"));
+is("", expandAlias(""));
+is("int32", expandAlias("int32"));
+
+is("uint32_t", mapScalarType("uint32"));
+is("void", mapScalarType("void"));
+is("uint64_t", mapScalarType("hyper"));
+
+my $x = { TYPE => "ENUM", NAME => "foo" };
+addType($x);
+is($x, getType("foo"));
+is(undef, getType("bloebla"));
+
+is(0, typeIs("someUnknownType", "ENUM"));
+
+is(1, hasType("foo"));
+is(0, hasType("nonexistant"));
+
+is(1, is_scalar("uint32"));
+is(0, is_scalar("nonexistant"));
+
+is(1, scalar_is_reference("string"));
+is(0, scalar_is_reference("uint32"));
+
+is("uint8", enum_type_fn({TYPE => "ENUM", PARENT=>{PROPERTIES => {enum8bit => 1}}}));
+is("uint32", enum_type_fn({TYPE => "ENUM", PARENT=>{PROPERTIES => {v1_enum => 1}}}));
+is("uint16", enum_type_fn({TYPE => "ENUM", PARENT=>{PROPERTIES => {}}}));
+
+is("uint8", bitmap_type_fn({TYPE => "BITMAP", PROPERTIES => {bitmap8bit => 1}}));
+is("uint16", bitmap_type_fn({TYPE => "BITMAP", PROPERTIES => {bitmap16bit => 1}}));
+is("hyper", bitmap_type_fn({TYPE => "BITMAP", PROPERTIES => {bitmap64bit => 1}}));
+is("uint32", bitmap_type_fn({TYPE => "BITMAP", PROPERTIES => {}}));
+
+is("enum foo", mapType({TYPE => "ENUM"}, "foo"));
+is("union foo", mapType({TYPE => "UNION"}, "foo"));
+is("struct foo", mapType({TYPE => "STRUCT"}, "foo"));
+is("uint8_t", mapType({TYPE => "BITMAP", PROPERTIES => {bitmap8bit => 1}}, "foo"));
+is("uint8_t", mapType({TYPE => "SCALAR"}, "uint8"));
+is("uint32_t", mapType({TYPE => "TYPEDEF", DATA => {TYPE => "SCALAR"}}, "uint32"));
+
+is("void", mapTypeName(undef));
+is("uint32_t", mapTypeName("uint32"));
+is("int32_t", mapTypeName("int"));


Property changes on: branches/SAMBA_4_0/source/pidl/tests/typelist.pl
___________________________________________________________________
Name: svn:executable
   + *



More information about the samba-cvs mailing list