pidl: Add simple test for ServerNDR.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 16 Jan 2008 14:07:00 +0000 (15:07 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 16 Jan 2008 14:08:00 +0000 (15:08 +0100)
source/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm
source/pidl/tests/samba3-srv.pl

index ecc43ab896c510eb688be53d6594f6cce4da53ff..ca9e7d15db019f0ef8c3ddb2d27f155fdf39260d 100644 (file)
@@ -6,6 +6,10 @@
 
 package Parse::Pidl::Samba3::ServerNDR;
 
+use Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(DeclLevel);
+
 use strict;
 use Parse::Pidl qw(warning fatal);
 use Parse::Pidl::Typelist qw(mapTypeName scalar_is_reference);
index dc96518fd0b063dd99841efa5d649507aee5f64c..d1e2bc9545af450c9bec0c2d437c813bb426091c 100644 (file)
@@ -4,11 +4,15 @@
 use strict;
 use warnings;
 
-use Test::More tests => 0;
+use Test::More tests => 1;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
-use Parse::Pidl::Util qw(MyDumper);
-use Parse::Pidl::Samba3::ServerNDR;
+use Parse::Pidl::Util qw(MyDumper has_property);
+use Parse::Pidl::Samba3::ServerNDR qw(DeclLevel);
 
+my $l = { TYPE => "DATA", DATA_TYPE => "uint32" }; 
+my $e = { FILE => "foo", LINE => 0, PROPERTIES => { }, TYPE => "uint32",
+          LEVELS => [ $l ] };
 
+is("uint32_t", DeclLevel($e, 0));