diff options
author | Jörg Mayer <jmayer@loplof.de> | 2013-11-06 22:48:50 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2013-11-06 22:48:50 +0000 |
commit | 02fe7ff23a82034fdde5d0c1d0c3bd433559ac6a (patch) | |
tree | 7456539e9cb063cef287cd9edc3ce11cc5b7f638 /tools/pidl/tests | |
parent | f9e5c14dde5b06b7a92c31babd0213c7a5a0ebcc (diff) | |
download | wireshark-02fe7ff23a82034fdde5d0c1d0c3bd433559ac6a.tar.gz |
Copy over the current WIP from samba.org::ftp/unpacked/samba_4_0_test/pidl
- As the pidl in Wireshark doesn't work anyway we can just mirror the WIP
so that patches to our code base are against the current code.
svn path=/trunk/; revision=53120
Diffstat (limited to 'tools/pidl/tests')
-rwxr-xr-x | tools/pidl/tests/ndr.pl | 39 | ||||
-rwxr-xr-x | tools/pidl/tests/samba-ndr.pl | 6 | ||||
-rwxr-xr-x | tools/pidl/tests/typelist.pl | 4 | ||||
-rwxr-xr-x | tools/pidl/tests/wireshark-ndr.pl | 2 |
4 files changed, 27 insertions, 24 deletions
diff --git a/tools/pidl/tests/ndr.pl b/tools/pidl/tests/ndr.pl index 9c301892ae..b6fd4899b0 100755 --- a/tools/pidl/tests/ndr.pl +++ b/tools/pidl/tests/ndr.pl @@ -22,7 +22,7 @@ my $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { 'IS_DEFERRED' => 0, 'LEVEL_INDEX' => 0, @@ -33,7 +33,7 @@ is_deeply(GetElementLevelTable($e, "unique"), [ } ]); -my $ne = ParseElement($e, "unique"); +my $ne = ParseElement($e, "unique", 0); is($ne->{ORIGINAL}, $e); is($ne->{NAME}, "v"); is($ne->{ALIGN}, 1); @@ -60,7 +60,7 @@ $e = { 'TYPE' => 'uint8', 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -90,7 +90,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -128,7 +128,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -158,7 +158,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -204,7 +204,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "ref"), [ +is_deeply(GetElementLevelTable($e, "ref", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -250,7 +250,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -280,7 +280,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -326,7 +326,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "unique"), [ +is_deeply(GetElementLevelTable($e, "unique", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -372,7 +372,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "ref"), [ +is_deeply(GetElementLevelTable($e, "ref", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -418,7 +418,7 @@ $e = { 'PARENT' => { TYPE => 'FUNCTION' }, 'LINE' => 42 }; -is_deeply(GetElementLevelTable($e, "ref"), [ +is_deeply(GetElementLevelTable($e, "ref", 0), [ { LEVEL_INDEX => 0, IS_DEFERRED => 0, @@ -463,7 +463,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -$ne = ParseElement($e, undef); +$ne = ParseElement($e, undef, 0); is($ne->{REPRESENTATION_TYPE}, "bar"); # representation_type @@ -476,7 +476,7 @@ $e = { 'PARENT' => { TYPE => 'STRUCT' }, 'LINE' => 42 }; -$ne = ParseElement($e, undef); +$ne = ParseElement($e, undef, 0); is($ne->{REPRESENTATION_TYPE}, "uint8"); is(align_type("hyper"), 8); @@ -521,7 +521,7 @@ $t = { }, ALIGN => undef }; -is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t); +is_deeply(ParseType($t->{ORIGINAL}, "ref", 0), $t); $t = { TYPE => "UNION", @@ -530,13 +530,14 @@ $t = { ELEMENTS => undef, PROPERTIES => undef, HAS_DEFAULT => 0, + IS_MS_UNION => 0, ORIGINAL => { TYPE => "UNION", NAME => "foo" }, ALIGN => undef }; -is_deeply(ParseType($t->{ORIGINAL}, "ref"), $t); +is_deeply(ParseType($t->{ORIGINAL}, "ref", 0), $t); ok(not can_contain_deferred("uint32")); ok(can_contain_deferred("some_unknown_type")); @@ -553,8 +554,8 @@ ok(not can_contain_deferred({ TYPE => "TYPEDEF", ok(can_contain_deferred({ TYPE => "STRUCT", ELEMENTS => [ { TYPE => "someunknowntype" } ]})); # Make sure the elements for a enum without body aren't filled in -ok(not defined(ParseType({TYPE => "ENUM", NAME => "foo" }, "ref")->{ELEMENTS})); +ok(not defined(ParseType({TYPE => "ENUM", NAME => "foo" }, "ref", 0)->{ELEMENTS})); # Make sure the elements for a bitmap without body aren't filled in -ok(not defined(ParseType({TYPE => "BITMAP", NAME => "foo" }, "ref")->{ELEMENTS})); +ok(not defined(ParseType({TYPE => "BITMAP", NAME => "foo" }, "ref", 0)->{ELEMENTS})); # Make sure the elements for a union without body aren't filled in -ok(not defined(ParseType({TYPE => "UNION", NAME => "foo" }, "ref")->{ELEMENTS})); +ok(not defined(ParseType({TYPE => "UNION", NAME => "foo" }, "ref", 0)->{ELEMENTS})); diff --git a/tools/pidl/tests/samba-ndr.pl b/tools/pidl/tests/samba-ndr.pl index e257817809..7c53cbc76f 100755 --- a/tools/pidl/tests/samba-ndr.pl +++ b/tools/pidl/tests/samba-ndr.pl @@ -221,7 +221,8 @@ $generator->ParseStructPush({ PROPERTIES => {}, ALIGN => 4, ELEMENTS => [ ]}, "ndr", "x"); -is($generator->{res}, "if (ndr_flags & NDR_SCALARS) { +is($generator->{res}, "NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags); +if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_trailer_align(ndr, 4)); } @@ -245,7 +246,8 @@ $generator->ParseStructPush({ ALIGN => 4, SURROUNDING_ELEMENT => $e, ELEMENTS => [ $e ]}, "ndr", "x"); -is($generator->{res}, "if (ndr_flags & NDR_SCALARS) { +is($generator->{res}, "NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags); +if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_uint3264(ndr, NDR_SCALARS, ndr_string_array_size(ndr, x->el1))); NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_mytype(ndr, NDR_SCALARS, &x->el1)); diff --git a/tools/pidl/tests/typelist.pl b/tools/pidl/tests/typelist.pl index e99b016487..681c0eacfd 100755 --- a/tools/pidl/tests/typelist.pl +++ b/tools/pidl/tests/typelist.pl @@ -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" }})); diff --git a/tools/pidl/tests/wireshark-ndr.pl b/tools/pidl/tests/wireshark-ndr.pl index 8c2cd47584..49ecc5c035 100755 --- a/tools/pidl/tests/wireshark-ndr.pl +++ b/tools/pidl/tests/wireshark-ndr.pl @@ -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 }}, }; "); |