wireshark/tools/pidl/tests/ndr_align.pl

145 lines
2.9 KiB
Perl
Raw Normal View History

#!/usr/bin/perl
# NDR alignment tests
# (C) 2005 Jelmer Vernooij. Published under the GNU GPL
use strict;
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
use Test::More tests => 5 * 8;
use FindBin qw($RealBin);
use lib "$RealBin/../lib";
use lib "$RealBin";
use Util qw(test_samba4_ndr);
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
test_samba4_ndr('align-uint8-uint16',
'
typedef [public] struct {
uint8 x;
uint16 y;
} bla;
',
'
struct ndr_push *ndr = ndr_push_init();
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 4 };
DATA_BLOB result_blob;
r.x = 13;
r.y = 0xbeef;
if (NT_STATUS_IS_ERR(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (!data_blob_equal(&result_blob, &expected_blob))
return 2;
');
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
test_samba4_ndr('align-uint8-uint32',
'
typedef [public] struct {
uint8 x;
uint32 y;
} bla;
',
'
struct ndr_push *ndr = ndr_push_init();
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0x00, 0x00, 0xef, 0xbe, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 8 };
DATA_BLOB result_blob;
r.x = 13;
r.y = 0xbeefbeef;
if (NT_STATUS_IS_ERR(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (!data_blob_equal(&result_blob, &expected_blob))
return 2;
');
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
test_samba4_ndr('align-uint8-hyper',
'
typedef [public] struct {
uint8 x;
hyper y;
} bla;
',
'
struct ndr_push *ndr = ndr_push_init();
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 16 };
DATA_BLOB result_blob;
r.x = 13;
r.y = 0xbeefbeefbeefbeef;
if (NT_STATUS_IS_ERR(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (!data_blob_equal(&result_blob, &expected_blob))
return 2;
');
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
test_samba4_ndr('noalignflag-uint8-uint16',
'
typedef [public] struct {
uint8 x;
uint16 y;
} bla;
',
'
struct ndr_push *ndr = ndr_push_init();
struct bla r;
uint8_t expected[] = { 0x0D, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 3 };
DATA_BLOB result_blob;
ndr->flags |= LIBNDR_FLAG_NOALIGN;
r.x = 13;
r.y = 0xbeef;
if (NT_STATUS_IS_ERR(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (!data_blob_equal(&result_blob, &expected_blob))
return 2;
');
Update from samba tree revision 12430 to 12487 ============================ Samba log start ============ ------------------------------------------------------------------------ r12462 | jelmer | 2005-12-24 22:57:51 +0100 (Sat, 24 Dec 2005) | 2 lines Hide oo magic from callers of the parser ------------------------------------------------------------------------ r12463 | jelmer | 2005-12-24 23:11:44 +0100 (Sat, 24 Dec 2005) | 2 lines Rename 'Samba' namespace to 'Samba4' ------------------------------------------------------------------------ r12464 | jelmer | 2005-12-25 00:32:50 +0100 (Sun, 25 Dec 2005) | 4 lines Add simple IDL parsing tests for pidl using the standard perl testing framework (Test::Simple, distributed with perl itself). Run these tests from 'make test' ------------------------------------------------------------------------ r12465 | jelmer | 2005-12-25 02:33:35 +0100 (Sun, 25 Dec 2005) | 3 lines Merge Parse::Pidl::Samba4::NDR::Header into Parse::Pidl::Samba4::NDR::Parser. Small optimization to avoid including NDR headers multiple times ------------------------------------------------------------------------ r12470 | jelmer | 2005-12-25 04:04:13 +0100 (Sun, 25 Dec 2005) | 3 lines Add helper module for pidl tests Convert other pidl tests to use Test::More and run them from 'make test' ------------------------------------------------------------------------ r12480 | jelmer | 2005-12-25 15:11:59 +0100 (Sun, 25 Dec 2005) | 2 lines Extend testsuite ------------------------------------------------------------------------ r12481 | jelmer | 2005-12-25 15:59:21 +0100 (Sun, 25 Dec 2005) | 4 lines Move parser-specific utility functions to idl.yp, remove some unused functions Allow the use of non-typedef structs and unions when declaring variables. Allow the use of the 'signed' and 'unsigned' qualifiers for integer types ------------------------------------------------------------------------ r12482 | jelmer | 2005-12-25 15:59:39 +0100 (Sun, 25 Dec 2005) | 2 lines Add some more tests ------------------------------------------------------------------------ r12483 | jelmer | 2005-12-25 16:19:55 +0100 (Sun, 25 Dec 2005) | 2 lines Remove --tdr-header option (merged into --tdr-parser) ------------------------------------------------------------------------ r12484 | jelmer | 2005-12-25 18:12:52 +0100 (Sun, 25 Dec 2005) | 2 lines Initial work on supporting non-typedeffed types ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=16896
2005-12-26 00:47:24 +00:00
test_samba4_ndr('align-blob-align2',
'
typedef [public] struct {
uint8 x;
[flag(LIBNDR_FLAG_ALIGN2)] DATA_BLOB data;
uint8 y;
Update from samba tree revision 19759 to 19883 ============================ Samba log start ============ ------------------------------------------------------------------------ r19790 | vlendec | 2006-11-19 18:56:35 +0100 (Sun, 19 Nov 2006) | 10 lines Changed paths: M /branches/SAMBA_3_0/source/libmsrpc/cac_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/ndr_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/winreg.h M /branches/SAMBA_3_0/source/rpcclient/cmd_unixinfo.c M /branches/SAMBA_3_0/source/utils/net_rpc_registry.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm Check in the PIDL change and the converted unixinfo and winbind pipes without waiting for comments. This is what version control is for, and it does fix a segfault I ran into ;-) Nevertheless, Jelmer & Jerry, please take a look! Thanks, Volker ------------------------------------------------------------------------ r19829 | jelmer | 2006-11-22 00:15:57 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/pidl Update documentation. ------------------------------------------------------------------------ r19830 | jelmer | 2006-11-22 00:21:08 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Warn about non-ref top-level pointers. ------------------------------------------------------------------------ r19834 | jelmer | 2006-11-22 14:59:14 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Prevent some inaccurate warnings. ------------------------------------------------------------------------ r19842 | jelmer | 2006-11-22 17:53:30 +0100 (Wed, 22 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Complain about unknown pointer types. Fallback to "unique" when "ptr" is specified instead of failing. ------------------------------------------------------------------------ r19845 | jelmer | 2006-11-22 18:13:19 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Add warning for pointer_default_top() ------------------------------------------------------------------------ r19854 | metze | 2006-11-23 14:11:08 +0100 (Thu, 23 Nov 2006) | 4 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm readd support for 'sptr' pointers, to work against windows servers until jelmer commits his 'ptr' support metze ------------------------------------------------------------------------ r19856 | jelmer | 2006-11-23 14:48:01 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/idl/epmapper.idl M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm Use sptr as basis for full ptr implementation. Will add checks for duplicates later. ------------------------------------------------------------------------ r19859 | jelmer | 2006-11-23 17:02:20 +0100 (Thu, 23 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/ndr/libndr.h M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/tests/Util.pm A /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Reuse referrent ids when pushing full pointers (still need to avoid pushing the referred object twice) and add test for full pointers. ------------------------------------------------------------------------ r19866 | jelmer | 2006-11-23 19:26:55 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Fix test compilation. ------------------------------------------------------------------------ r19868 | jelmer | 2006-11-23 21:59:09 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/Util.pm M /branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_string.pl Fix more tests. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=19979
2006-11-25 10:35:39 +00:00
} blie;
',
'
struct ndr_push *ndr = ndr_push_init();
Update from samba tree revision 19759 to 19883 ============================ Samba log start ============ ------------------------------------------------------------------------ r19790 | vlendec | 2006-11-19 18:56:35 +0100 (Sun, 19 Nov 2006) | 10 lines Changed paths: M /branches/SAMBA_3_0/source/libmsrpc/cac_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/ndr_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/winreg.h M /branches/SAMBA_3_0/source/rpcclient/cmd_unixinfo.c M /branches/SAMBA_3_0/source/utils/net_rpc_registry.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm Check in the PIDL change and the converted unixinfo and winbind pipes without waiting for comments. This is what version control is for, and it does fix a segfault I ran into ;-) Nevertheless, Jelmer & Jerry, please take a look! Thanks, Volker ------------------------------------------------------------------------ r19829 | jelmer | 2006-11-22 00:15:57 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/pidl Update documentation. ------------------------------------------------------------------------ r19830 | jelmer | 2006-11-22 00:21:08 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Warn about non-ref top-level pointers. ------------------------------------------------------------------------ r19834 | jelmer | 2006-11-22 14:59:14 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Prevent some inaccurate warnings. ------------------------------------------------------------------------ r19842 | jelmer | 2006-11-22 17:53:30 +0100 (Wed, 22 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Complain about unknown pointer types. Fallback to "unique" when "ptr" is specified instead of failing. ------------------------------------------------------------------------ r19845 | jelmer | 2006-11-22 18:13:19 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Add warning for pointer_default_top() ------------------------------------------------------------------------ r19854 | metze | 2006-11-23 14:11:08 +0100 (Thu, 23 Nov 2006) | 4 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm readd support for 'sptr' pointers, to work against windows servers until jelmer commits his 'ptr' support metze ------------------------------------------------------------------------ r19856 | jelmer | 2006-11-23 14:48:01 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/idl/epmapper.idl M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm Use sptr as basis for full ptr implementation. Will add checks for duplicates later. ------------------------------------------------------------------------ r19859 | jelmer | 2006-11-23 17:02:20 +0100 (Thu, 23 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/ndr/libndr.h M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/tests/Util.pm A /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Reuse referrent ids when pushing full pointers (still need to avoid pushing the referred object twice) and add test for full pointers. ------------------------------------------------------------------------ r19866 | jelmer | 2006-11-23 19:26:55 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Fix test compilation. ------------------------------------------------------------------------ r19868 | jelmer | 2006-11-23 21:59:09 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/Util.pm M /branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_string.pl Fix more tests. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=19979
2006-11-25 10:35:39 +00:00
struct blie r;
uint8_t data[] = { 0x01, 0x02 };
uint8_t expected[] = { 0x0D, 0x00, 0x0E };
DATA_BLOB expected_blob = { expected, 3 };
DATA_BLOB result_blob;
r.x = 13;
r.y = 14;
r.data.data = data;
r.data.length = 2;
Update from samba tree revision 19759 to 19883 ============================ Samba log start ============ ------------------------------------------------------------------------ r19790 | vlendec | 2006-11-19 18:56:35 +0100 (Sun, 19 Nov 2006) | 10 lines Changed paths: M /branches/SAMBA_3_0/source/libmsrpc/cac_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_unixinfo.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/cli_winreg.h M /branches/SAMBA_3_0/source/librpc/gen_ndr/ndr_winreg.c M /branches/SAMBA_3_0/source/librpc/gen_ndr/winreg.h M /branches/SAMBA_3_0/source/rpcclient/cmd_unixinfo.c M /branches/SAMBA_3_0/source/utils/net_rpc_registry.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4.pm Check in the PIDL change and the converted unixinfo and winbind pipes without waiting for comments. This is what version control is for, and it does fix a segfault I ran into ;-) Nevertheless, Jelmer & Jerry, please take a look! Thanks, Volker ------------------------------------------------------------------------ r19829 | jelmer | 2006-11-22 00:15:57 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/pidl Update documentation. ------------------------------------------------------------------------ r19830 | jelmer | 2006-11-22 00:21:08 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Warn about non-ref top-level pointers. ------------------------------------------------------------------------ r19834 | jelmer | 2006-11-22 14:59:14 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Prevent some inaccurate warnings. ------------------------------------------------------------------------ r19842 | jelmer | 2006-11-22 17:53:30 +0100 (Wed, 22 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Complain about unknown pointer types. Fallback to "unique" when "ptr" is specified instead of failing. ------------------------------------------------------------------------ r19845 | jelmer | 2006-11-22 18:13:19 +0100 (Wed, 22 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm Add warning for pointer_default_top() ------------------------------------------------------------------------ r19854 | metze | 2006-11-23 14:11:08 +0100 (Thu, 23 Nov 2006) | 4 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm readd support for 'sptr' pointers, to work against windows servers until jelmer commits his 'ptr' support metze ------------------------------------------------------------------------ r19856 | jelmer | 2006-11-23 14:48:01 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/idl/epmapper.idl M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm M /branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm Use sptr as basis for full ptr implementation. Will add checks for duplicates later. ------------------------------------------------------------------------ r19859 | jelmer | 2006-11-23 17:02:20 +0100 (Thu, 23 Nov 2006) | 3 lines Changed paths: M /branches/SAMBA_4_0/source/librpc/ndr/libndr.h M /branches/SAMBA_4_0/source/librpc/ndr/ndr_basic.c M /branches/SAMBA_4_0/source/pidl/tests/Util.pm A /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Reuse referrent ids when pushing full pointers (still need to avoid pushing the referred object twice) and add test for full pointers. ------------------------------------------------------------------------ r19866 | jelmer | 2006-11-23 19:26:55 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/ndr_fullptr.pl Fix test compilation. ------------------------------------------------------------------------ r19868 | jelmer | 2006-11-23 21:59:09 +0100 (Thu, 23 Nov 2006) | 2 lines Changed paths: M /branches/SAMBA_4_0/source/pidl/tests/Util.pm M /branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl M /branches/SAMBA_4_0/source/pidl/tests/ndr_string.pl Fix more tests. ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=19979
2006-11-25 10:35:39 +00:00
if (NT_STATUS_IS_ERR(ndr_push_blie(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (!data_blob_equal(&result_blob, &expected_blob))
return 2;
');