diff options
author | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-07-08 10:20:30 +0000 |
---|---|---|
committer | jmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7> | 2007-07-08 10:20:30 +0000 |
commit | 097b11fdc498b031604eaca7a4e39824124ea55a (patch) | |
tree | 88d2546dea9509b2d7b9864a4bc06205889359f5 /tools | |
parent | 46a618b1866fc271bb0ee7aba667e8e91806833f (diff) |
Update from samba tree revision 23135 to 23750
============================ Samba log start ============
------------------------------------------------------------------------
r23677 | abartlet | 2007-07-03 09:28:46 +0200 (Tue, 03 Jul 2007) | 6 lines
Changed paths:
M /branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl
M /branches/SAMBA_4_0/source/pidl/tests/ndr_tagtype.pl
When I removed data_blob_equal, I clearly didn't test the PIDL code.
Fix these to use the new data_blob_cmp()
Andrew Bartlett
------------------------------------------------------------------------
r23721 | sahlberg | 2007-07-05 09:19:14 +0200 (Thu, 05 Jul 2007) | 7 lines
Changed paths:
M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
For unions, The TAG and the ARM are aligned independently.
Move emitting ALIGN_TO_x_BYTES to after the tag has been dissected so the
alignment only affects the ARM.
------------------------------------------------------------------------
------------------------------------------------------------------------
============================ Samba log end ==============
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22268 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm | 12 | ||||
-rwxr-xr-x | tools/pidl/tests/ndr_align.pl | 10 | ||||
-rwxr-xr-x | tools/pidl/tests/ndr_tagtype.pl | 6 |
3 files changed, 14 insertions, 14 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm index ac923bef74..ffe104c941 100644 --- a/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm +++ b/tools/pidl/lib/Parse/Pidl/Wireshark/NDR.pm @@ -614,12 +614,6 @@ sub Union($$$$) $self->pidl_code("$switch_type level;"); $self->pidl_code(""); - if ($e->{ALIGN} > 1) { - $self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;"); - } - - $self->pidl_code(""); - $self->pidl_code("old_offset = offset;"); $self->pidl_code("if (parent_tree) {"); $self->indent; @@ -632,6 +626,12 @@ sub Union($$$$) $self->pidl_code("offset = $switch_dissect(tvb, offset, pinfo, tree, drep, hf_index, &level);"); + if ($e->{ALIGN} > 1) { + $self->pidl_code("ALIGN_TO_$e->{ALIGN}_BYTES;"); + $self->pidl_code(""); + } + + $self->pidl_code("switch(level) {$res\t}"); $self->pidl_code("proto_item_set_len(item, offset-old_offset);\n"); $self->pidl_code("return offset;"); diff --git a/tools/pidl/tests/ndr_align.pl b/tools/pidl/tests/ndr_align.pl index 405b74597c..0824acc501 100755 --- a/tools/pidl/tests/ndr_align.pl +++ b/tools/pidl/tests/ndr_align.pl @@ -29,7 +29,7 @@ test_samba4_ndr('align-uint8-uint16', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -54,7 +54,7 @@ test_samba4_ndr('align-uint8-uint32', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -81,7 +81,7 @@ test_samba4_ndr('align-uint8-hyper', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -108,7 +108,7 @@ test_samba4_ndr('noalignflag-uint8-uint16', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -138,6 +138,6 @@ test_samba4_ndr('align-blob-align2', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); diff --git a/tools/pidl/tests/ndr_tagtype.pl b/tools/pidl/tests/ndr_tagtype.pl index d7839426d5..f8250a90ef 100755 --- a/tools/pidl/tests/ndr_tagtype.pl +++ b/tools/pidl/tests/ndr_tagtype.pl @@ -22,7 +22,7 @@ test_samba4_ndr('struct-notypedef', '[public] struct bla { uint8 x; }; ', result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -41,7 +41,7 @@ test_samba4_ndr('struct-notypedef-used', '[public] struct bla { uint8 x; }; result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); @@ -61,6 +61,6 @@ test_samba4_ndr('struct-notypedef-embedded', 'struct bla { uint8 x; }; result_blob = ndr_push_blob(ndr); - if (!data_blob_equal(&result_blob, &expected_blob)) + if (data_blob_cmp(&result_blob, &expected_blob) != 0) return 2; '); |