2 # NDR represent_as() / transmit_as() tests
3 # (C) 2006 Jelmer Vernooij. Published under the GNU GPL
7 use Test
::More tests
=> 2 * 8;
8 use FindBin
qw($RealBin);
10 use Util qw(test_samba4_ndr);
12 test_samba4_ndr
('represent_as-simple',
14 void bla([in,represent_as(uint32)] uint8 x);
17 uint8_t expected[] = { 0x0D };
18 DATA_BLOB in_blob = { expected, 1 };
19 struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL, NULL);
22 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
29 enum ndr_err_code ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
32 return NDR_ERR_SUCCESS;
35 enum ndr_err_code ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
38 return NDR_ERR_SUCCESS;
43 test_samba4_ndr
('transmit_as-simple',
45 void bla([in,transmit_as(uint32)] uint8 x);
48 uint8_t expected[] = { 0x0D };
49 DATA_BLOB in_blob = { expected, 1 };
50 struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL, NULL);
53 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
60 enum ndr_err_code ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
63 return NDR_ERR_SUCCESS;
66 enum ndr_err_code ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
69 return NDR_ERR_SUCCESS;