wireshark/tools/pidl/tests/ndr_align.pl

144 lines
3.0 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";
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_ctx(NULL, NULL);
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 (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (data_blob_cmp(&result_blob, &expected_blob) != 0)
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_ctx(NULL, NULL);
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 (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (data_blob_cmp(&result_blob, &expected_blob) != 0)
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_ctx(NULL, NULL);
struct bla r;
uint8_t expected[] = { 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Update from samba tree revision 25306 to 25880 ============================ Samba log start ============ ------------------------------------------------------------------------ r25453 | jelmer | 2007-10-01 23:38:15 +0200 (Mon, 01 Oct 2007) | 1 line Fix include for NTSTATUS. ------------------------------------------------------------------------ r25457 | jelmer | 2007-10-02 06:45:25 +0200 (Tue, 02 Oct 2007) | 1 line use different location for out-of-tree builds ------------------------------------------------------------------------ r25674 | metze | 2007-10-17 10:26:55 +0200 (Wed, 17 Oct 2007) | 13 lines fix crash bug in pidl generated client code, this could have happend with [in,out,unique] pointers when the clients sends a valid pointer, but the server reponse with a NULL pointer (as samba-3.0.26a do for some calls). I've tested with midl to see how windows handles this situation and also the reverse case where the client sends NULL and the server reposnse with non-NULL. It appears that midl generated code just ignores this and only copies the result if both pointers are non-NULL. metze ------------------------------------------------------------------------ r25700 | jra | 2007-10-19 02:40:51 +0200 (Fri, 19 Oct 2007) | 3 lines Now BOOL no longer exists in Samba 3.2, use bool instead. Jeremy. ------------------------------------------------------------------------ r25745 | metze | 2007-10-27 11:57:09 +0200 (Sat, 27 Oct 2007) | 6 lines [pidl] ndr_pull/push_error(ndr, NDR_ERR_INVALID_POINTER,..) instead NT_STATUS_INVALID_PARAMETER_MIX metze ------------------------------------------------------------------------ r25751 | metze | 2007-10-30 07:24:43 +0100 (Tue, 30 Oct 2007) | 4 lines use EJS_CHECK() instead of NDR_CHECK() in ejs code metze ------------------------------------------------------------------------ r25765 | metze | 2007-10-31 17:25:44 +0100 (Wed, 31 Oct 2007) | 3 lines pidl: fix compiler warning in ndr_align test metze ------------------------------------------------------------------------ r25766 | metze | 2007-10-31 17:27:21 +0100 (Wed, 31 Oct 2007) | 3 lines pidl: fix bugs in ndr_tagtype tests found by compiler warnings metze ------------------------------------------------------------------------ r25767 | metze | 2007-10-31 17:29:32 +0100 (Wed, 31 Oct 2007) | 5 lines pidl: make it easier to debug errors in pidl tests we now print the C program that we tried to compile metze ------------------------------------------------------------------------ r25768 | metze | 2007-10-31 17:44:42 +0100 (Wed, 31 Oct 2007) | 5 lines pidl: NT_STATUS_IS_ERR() is NOT the same as !NT_STATUS_IS_OK() Everything but success should be handled as error in the tests. metze ------------------------------------------------------------------------ r25795 | metze | 2007-11-02 11:35:09 +0100 (Fri, 02 Nov 2007) | 3 lines whitespace cleanup... metze ------------------------------------------------------------------------ r25804 | metze | 2007-11-02 14:02:25 +0100 (Fri, 02 Nov 2007) | 4 lines move including ndr_compression.h into HeaderInterface() metze ------------------------------------------------------------------------ r25805 | metze | 2007-11-02 14:05:43 +0100 (Fri, 02 Nov 2007) | 4 lines pidl: include libndr.h as first header in ndr_foo.h metze ------------------------------------------------------------------------ r25806 | metze | 2007-11-02 14:48:11 +0100 (Fri, 02 Nov 2007) | 5 lines let libndr.h include needed stuff and remove pidl magic for choosing common required headers metze ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=23378
2007-11-06 18:31:26 +00:00
0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe, 0xef, 0xbe };
DATA_BLOB expected_blob = { expected, 16 };
DATA_BLOB result_blob;
r.x = 13;
Update from samba tree revision 25306 to 25880 ============================ Samba log start ============ ------------------------------------------------------------------------ r25453 | jelmer | 2007-10-01 23:38:15 +0200 (Mon, 01 Oct 2007) | 1 line Fix include for NTSTATUS. ------------------------------------------------------------------------ r25457 | jelmer | 2007-10-02 06:45:25 +0200 (Tue, 02 Oct 2007) | 1 line use different location for out-of-tree builds ------------------------------------------------------------------------ r25674 | metze | 2007-10-17 10:26:55 +0200 (Wed, 17 Oct 2007) | 13 lines fix crash bug in pidl generated client code, this could have happend with [in,out,unique] pointers when the clients sends a valid pointer, but the server reponse with a NULL pointer (as samba-3.0.26a do for some calls). I've tested with midl to see how windows handles this situation and also the reverse case where the client sends NULL and the server reposnse with non-NULL. It appears that midl generated code just ignores this and only copies the result if both pointers are non-NULL. metze ------------------------------------------------------------------------ r25700 | jra | 2007-10-19 02:40:51 +0200 (Fri, 19 Oct 2007) | 3 lines Now BOOL no longer exists in Samba 3.2, use bool instead. Jeremy. ------------------------------------------------------------------------ r25745 | metze | 2007-10-27 11:57:09 +0200 (Sat, 27 Oct 2007) | 6 lines [pidl] ndr_pull/push_error(ndr, NDR_ERR_INVALID_POINTER,..) instead NT_STATUS_INVALID_PARAMETER_MIX metze ------------------------------------------------------------------------ r25751 | metze | 2007-10-30 07:24:43 +0100 (Tue, 30 Oct 2007) | 4 lines use EJS_CHECK() instead of NDR_CHECK() in ejs code metze ------------------------------------------------------------------------ r25765 | metze | 2007-10-31 17:25:44 +0100 (Wed, 31 Oct 2007) | 3 lines pidl: fix compiler warning in ndr_align test metze ------------------------------------------------------------------------ r25766 | metze | 2007-10-31 17:27:21 +0100 (Wed, 31 Oct 2007) | 3 lines pidl: fix bugs in ndr_tagtype tests found by compiler warnings metze ------------------------------------------------------------------------ r25767 | metze | 2007-10-31 17:29:32 +0100 (Wed, 31 Oct 2007) | 5 lines pidl: make it easier to debug errors in pidl tests we now print the C program that we tried to compile metze ------------------------------------------------------------------------ r25768 | metze | 2007-10-31 17:44:42 +0100 (Wed, 31 Oct 2007) | 5 lines pidl: NT_STATUS_IS_ERR() is NOT the same as !NT_STATUS_IS_OK() Everything but success should be handled as error in the tests. metze ------------------------------------------------------------------------ r25795 | metze | 2007-11-02 11:35:09 +0100 (Fri, 02 Nov 2007) | 3 lines whitespace cleanup... metze ------------------------------------------------------------------------ r25804 | metze | 2007-11-02 14:02:25 +0100 (Fri, 02 Nov 2007) | 4 lines move including ndr_compression.h into HeaderInterface() metze ------------------------------------------------------------------------ r25805 | metze | 2007-11-02 14:05:43 +0100 (Fri, 02 Nov 2007) | 4 lines pidl: include libndr.h as first header in ndr_foo.h metze ------------------------------------------------------------------------ r25806 | metze | 2007-11-02 14:48:11 +0100 (Fri, 02 Nov 2007) | 5 lines let libndr.h include needed stuff and remove pidl magic for choosing common required headers metze ------------------------------------------------------------------------ ------------------------------------------------------------------------ ============================ Samba log end ============== svn path=/trunk/; revision=23378
2007-11-06 18:31:26 +00:00
r.y = 0xbeefbeefbeefbeefLLU;
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (data_blob_cmp(&result_blob, &expected_blob) != 0)
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_ctx(NULL, NULL);
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 (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (data_blob_cmp(&result_blob, &expected_blob) != 0)
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_ctx(NULL, NULL);
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;
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_blie(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
return 1;
result_blob = ndr_push_blob(ndr);
if (data_blob_cmp(&result_blob, &expected_blob) != 0)
return 2;
');