At file:///home/jelmer/bzr.samba/SAMBA_4_0/

------------------------------------------------------------
revno: 11601
revision-id: [EMAIL PROTECTED]
parent: svn-v2:[EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: SAMBA_4_0
timestamp: Tue 2007-02-27 14:39:30 +0100
message:
  More tests.
modified:
  source/pidl/tests/wireshark-conf.pl svn-v2:[EMAIL PROTECTED]
=== modified file 'source/pidl/tests/wireshark-conf.pl'
--- a/source/pidl/tests/wireshark-conf.pl       2007-02-27 12:46:19 +0000
+++ b/source/pidl/tests/wireshark-conf.pl       2007-02-27 13:39:30 +0000
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 34;
+use Test::More tests => 45;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -94,3 +94,72 @@
 
 test_warnings("nofile:1: invalid BASE_TYPE `BLOE'\n",
        sub { parse_conf("TYPE winreg_String dissect_myminregstring FT_UINT32 
BLOE 0 0 2\n"); });
+
+is_deeply(parse_conf("TFS hf_bla \"True string\" \"False String\"\n"),
+               { tfs => { hf_bla => {
+                                       TRUE_STRING => "\"True string\"",
+                                  FALSE_STRING => "\"False String\"" } } });
+
+test_errors("nofile:1: incomplete TFS command\n",
+       sub { parse_conf("TFS hf_bla \"Trues\""); } );
+
+test_errors("nofile:1: incomplete PARAM_VALUE command\n",
+       sub { parse_conf("PARAM_VALUE\n"); });
+
+is_deeply(parse_conf("PARAM_VALUE Life 42\n"),
+       { dissectorparams => {
+                       Life => {
+                               DISSECTOR => "Life",
+                               POS => { FILE => "nofile", LINE => 1 },
+                               PARAM => 42,
+                               USED => 0
+                       }
+               }
+       });
+
+is_deeply(parse_conf("STRIP_PREFIX bla_\n"),
+       { strip_prefixes => [ "bla_" ] });
+
+is_deeply(parse_conf("STRIP_PREFIX bla_\nSTRIP_PREFIX bloe\n"),
+       { strip_prefixes => [ "bla_", "bloe" ] });
+
+is_deeply(parse_conf("PROTOCOL atsvc \"Scheduling jobs on remote machines\" 
\"at\" \"atsvc\"\n"), 
+       { protocols => {
+                       atsvc => {
+                               LONGNAME => "\"Scheduling jobs on remote 
machines\"",
+                               SHORTNAME => "\"at\"",
+                               FILTERNAME => "\"atsvc\""
+                       }
+               }
+       }
+);
+
+is_deeply(parse_conf("IMPORT bla\n"), {
+               imports => {
+                       bla => {
+                               NAME => "bla",
+                               DATA => "",
+                               USED => 0,
+                               POS => { FILE => "nofile", LINE => 1 }
+                       }
+               }
+       }
+);
+
+is_deeply(parse_conf("IMPORT bla fn1 fn2 fn3\n"), {
+               imports => {
+                       bla => {
+                               NAME => "bla",
+                               DATA => "fn1 fn2 fn3",
+                               USED => 0,
+                               POS => { FILE => "nofile", LINE => 1 }
+                       }
+               }
+       }
+);
+
+test_errors("nofile:1: no dissectorname specified\n",
+       sub { parse_conf("IMPORT\n"); } );
+
+test_errors("nofile:1: incomplete HF_FIELD command\n",
+       sub { parse_conf("HF_FIELD hf_idx\n"); });

Reply via email to