New version of pidl
This commit is contained in:
parent
d595112e01
commit
2186300bd2
74 changed files with 23043 additions and 988 deletions
|
@ -118,7 +118,7 @@ $c
|
|||
my $test_data_prefix = $ENV{TEST_DATA_PREFIX};
|
||||
my $outfile;
|
||||
if (defined($test_data_prefix)) {
|
||||
$outfile = "$test_data_prefix/test-$name";
|
||||
$outfile = "$test_data_prefix/test-$name";
|
||||
} else {
|
||||
$outfile = "./test-$name";
|
||||
}
|
||||
|
|
|
@ -52,14 +52,14 @@ is(1, typeIs("uint32", "SCALAR"));
|
|||
is(0, typeIs("uint32", "ENUM"));
|
||||
|
||||
is(1, hasType("foo"));
|
||||
is(0, hasType("nonexistant"));
|
||||
is(0, hasType("nonexistent"));
|
||||
is(0, hasType({TYPE => "ENUM", NAME => "someUnknownType"}));
|
||||
is(1, hasType({TYPE => "ENUM", NAME => "foo"}));
|
||||
is(1, hasType({TYPE => "ENUM"}));
|
||||
is(1, hasType({TYPE => "STRUCT"}));
|
||||
|
||||
is(1, is_scalar("uint32"));
|
||||
is(0, is_scalar("nonexistant"));
|
||||
is(0, is_scalar("nonexistent"));
|
||||
is(1, is_scalar({TYPE => "ENUM"}));
|
||||
is(0, is_scalar({TYPE => "STRUCT"}));
|
||||
is(1, is_scalar({TYPE => "TYPEDEF", DATA => {TYPE => "ENUM" }}));
|
||||
|
|
|
@ -15,7 +15,7 @@ use Parse::Pidl::Wireshark::Conformance qw(ReadConformanceFH valid_ft_type valid
|
|||
sub parse_conf($)
|
||||
{
|
||||
my $str = shift;
|
||||
open(TMP, "+>", undef) or die("unable to open temp file");
|
||||
open(TMP, "+>", undef) or die("unable to open temp file");
|
||||
print TMP $str;
|
||||
seek(TMP, 0, 0);
|
||||
my $data = {};
|
||||
|
@ -60,7 +60,7 @@ is_deeply(parse_conf("FIELD_DESCRIPTION foo my description\n"),
|
|||
|
||||
is_deeply(parse_conf("CODE START\ndata\nCODE END\n"), { override => "data\n" });
|
||||
is_deeply(parse_conf("CODE START\ndata\nmore data\nCODE END\n"), { override => "data\nmore data\n" });
|
||||
test_warnings("nofile:1: Unknown command `CODE'\n",
|
||||
test_warnings("nofile:1: CODE END outside CODE section\n",
|
||||
sub { parse_conf("CODE END\n"); } );
|
||||
|
||||
is_deeply(parse_conf("TYPE winreg_String dissect_myminregstring(); FT_STRING BASE_DEC 0 0 2\n"), { types => { winreg_String => {
|
||||
|
|
|
@ -14,7 +14,7 @@ use strict;
|
|||
use Parse::Pidl::Wireshark::NDR qw(field2name %res PrintIdl StripPrefixes RegisterInterfaceHandoff register_hf_field ProcessImport ProcessInclude find_type DumpEttList DumpEttDeclaration DumpHfList DumpHfDeclaration DumpFunctionTable register_type register_ett);
|
||||
|
||||
is("Access Mask", field2name("access_mask"));
|
||||
is("Accessmask", field2name("AccessMask"));
|
||||
is("AccessMask", field2name("AccessMask"));
|
||||
|
||||
my $x = new Parse::Pidl::Wireshark::NDR();
|
||||
$x->PrintIdl("foo\nbar\n");
|
||||
|
@ -227,7 +227,7 @@ $x->{conformance} = {
|
|||
};
|
||||
|
||||
is($x->DumpHfList(), "\tstatic hf_register_info hf[] = {
|
||||
{ &hf_bla,
|
||||
{ &hf_bla,
|
||||
{ \"Bla\", \"bla.field\", FT_UINT32, BASE_DEC, NULL, 255, \"NULL\", HFILL }},
|
||||
};
|
||||
");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue