Rev 11504: Add some simple tests for the wireshark NDR generator.
in file:///home/jelmer/bzr.samba/SAMBA_4_0/
Jelmer Vernooij
jelmer at samba.org
Sat Feb 17 23:35:43 GMT 2007
At file:///home/jelmer/bzr.samba/SAMBA_4_0/
------------------------------------------------------------
revno: 11504
revision-id: jelmer at samba.org-20070217233534-x58078kx0zci6831
parent: svn-v2:21410 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: SAMBA_4_0
timestamp: Sun 2007-02-18 00:35:34 +0100
message:
Add some simple tests for the wireshark NDR generator.
added:
source/pidl/tests/wireshark-ndr.pl wiresharkndr.pl-20070217232511-uxhtsh9s3s89r0gx-1
modified:
source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm svn-v2:16824 at 0c0555d6-39d7-0310-84fc-f1cc0bd64818-branches%2fSAMBA_4_0-source%2fpidl%2flib%2fParse%2fPidl%2fWireshark%2fNDR.pm
=== added file 'source/pidl/tests/wireshark-ndr.pl'
--- a/source/pidl/tests/wireshark-ndr.pl 1970-01-01 00:00:00 +0000
+++ b/source/pidl/tests/wireshark-ndr.pl 2007-02-17 23:35:34 +0000
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+# (C) 2007 Jelmer Vernooij <jelmer at samba.org>
+# Published under the GNU General Public License
+# test parsing wireshark conformance files
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+use FindBin qw($RealBin);
+use lib "$RealBin";
+use Util;
+use Parse::Pidl::Util qw(MyDumper);
+use Parse::Pidl::Wireshark::NDR qw(field2name %res PrintIdl);
+
+is("Access Mask", field2name("access_mask"));
+is("Accessmask", field2name("AccessMask"));
+
+$res{code} = "";
+PrintIdl("foo\nbar\n");
+is("/* IDL: foo */
+/* IDL: bar */
+
+", $res{code});
=== modified file 'source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm'
--- a/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm 2007-02-14 14:42:42 +0000
+++ b/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm 2007-02-17 23:35:34 +0000
@@ -16,6 +16,10 @@
package Parse::Pidl::Wireshark::NDR;
+use Exporter;
+ at ISA = qw(Exporter);
+ at EXPORT_OK = qw(field2name @ett %res PrintIdl);
+
use strict;
use Parse::Pidl qw(error warning);
use Parse::Pidl::Typelist qw(getType);
@@ -28,7 +32,7 @@
use vars qw($VERSION);
$VERSION = '0.01';
-my @ett;
+our @ett;
my %hf_used = ();
my %return_types = ();
@@ -66,7 +70,7 @@
return $field;
}
-my %res = ();
+our %res = ();
my $tabs = "";
my $cur_fn = undef;
sub pidl_fn_start($)
@@ -108,7 +112,7 @@
sub PrintIdl($)
{
- my $idl = shift;
+ my ($idl) = @_;
foreach (split /\n/, $idl) {
pidl_code "/* IDL: $_ */";
More information about the samba-cvs
mailing list