[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha2-897-gd1aa252

Jelmer Vernooij jelmer at samba.org
Tue Feb 19 01:04:06 GMT 2008


The branch, v4-0-test has been updated
       via  d1aa25249d64513f785430cab7437b5c7ca8db27 (commit)
       via  8a8ed4fae849a2cc565a1ff77b2208a4cd6b1edb (commit)
      from  60f2eb404628f9903bbb839a9aaead89c7a5736f (commit)

http://gitweb.samba.org/?samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit d1aa25249d64513f785430cab7437b5c7ca8db27
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Feb 19 02:02:48 2008 +0100

    Add test for INCLUDE command.

commit 8a8ed4fae849a2cc565a1ff77b2208a4cd6b1edb
Author: Julien Kerihuel <j.kerihuel at openchange.org>
Date:   Tue Feb 19 01:55:01 2008 +0100

    Add INCLUDE command to pidl.

-----------------------------------------------------------------------

Summary of changes:
 .../pidl/lib/Parse/Pidl/Wireshark/Conformance.pm   |   23 ++++++++++++++++++-
 source/pidl/tests/wireshark-conf.pl                |    6 +++-
 2 files changed, 25 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm b/source/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
index a240bbf..5c37b4a 100644
--- a/source/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
+++ b/source/pidl/lib/Parse/Pidl/Wireshark/Conformance.pm
@@ -74,6 +74,10 @@ Change description for the specified header field. `field' is the hf name of the
 Code to insert when generating the specified dissector. @HF@ and 
 @PARAM@ will be substituted.
 
+=item I<INCLUDE> filename
+
+Include conformance data from the specified filename in the dissector.
+
 =item I<TFS> hf_name "true string" "false string"
 
 Override the text shown when a bitmap boolean value is enabled or disabled.
@@ -326,11 +330,25 @@ sub handle_ett_field
 	unless(defined($ett)) {
 		error($pos, "incomplete ETT_FIELD command");
 		return;
-	};
+	}
 
 	push (@{$data->{ett}}, $ett);
 }
 
+sub handle_include
+{
+	my $pos = shift @_;
+	my $data = shift @_;
+	my $fn = shift @_;
+
+	unless(defined($fn)) {
+		error($pos, "incomplete INCLUDE command");
+		return;
+	}
+
+	ReadConformance($fn, $data);
+}
+
 my %field_handlers = (
 	TYPE => \&handle_type,
 	NOEMIT => \&handle_noemit, 
@@ -343,7 +361,8 @@ my %field_handlers = (
 	STRIP_PREFIX => \&handle_strip_prefix,
 	PROTOCOL => \&handle_protocol,
 	FIELD_DESCRIPTION => \&handle_fielddescription,
-	IMPORT => \&handle_import
+	IMPORT => \&handle_import,
+	INCLUDE => \&handle_include
 );
 
 sub ReadConformance($$)
diff --git a/source/pidl/tests/wireshark-conf.pl b/source/pidl/tests/wireshark-conf.pl
index c06ac16..9da5c7d 100755
--- a/source/pidl/tests/wireshark-conf.pl
+++ b/source/pidl/tests/wireshark-conf.pl
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 48;
+use Test::More tests => 49;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -35,7 +35,6 @@ test_warnings("nofile:1: Unknown command `foobar'\n",
 test_warnings("nofile:1: incomplete HF_RENAME command\n",
 	sub { parse_conf("HF_RENAME\n"); });
 
-
 is_deeply(parse_conf("HF_RENAME foo bar\n")->{hf_renames}->{foo}, 
 	{ OLDNAME => "foo", NEWNAME => "bar", POS => {FILE => "nofile", LINE => 1}, USED => 0});
 
@@ -47,6 +46,9 @@ test_warnings("nofile:1: incomplete MANUAL command\n",
 
 is_deeply(parse_conf("MANUAL foo\n"), { manual => {foo => 1}});
 
+test_errors("nofile:1: incomplete INCLUDE command\n",
+	sub { parse_conf("INCLUDE\n"); } );
+
 test_warnings("nofile:1: incomplete FIELD_DESCRIPTION command\n",
 	sub { parse_conf("FIELD_DESCRIPTION foo\n"); });
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list