| Line | |
|---|
| 1 | #!/usr/bin/perl
|
|---|
| 2 | # Some simple tests for pidl
|
|---|
| 3 | # (C) 2005 Jelmer Vernooij <jelmer@samba.org>
|
|---|
| 4 | # Published under the GNU General Public License
|
|---|
| 5 | use strict;
|
|---|
| 6 |
|
|---|
| 7 | use Test::More tests => 8;
|
|---|
| 8 | use FindBin qw($RealBin);
|
|---|
| 9 | use lib "$RealBin";
|
|---|
| 10 | use Util qw(test_samba4_ndr);
|
|---|
| 11 |
|
|---|
| 12 | test_samba4_ndr("simple", "void Test(); ",
|
|---|
| 13 | "
|
|---|
| 14 | uint8_t data[] = { 0x02 };
|
|---|
| 15 | uint8_t result;
|
|---|
| 16 | DATA_BLOB b;
|
|---|
| 17 | struct ndr_pull *ndr;
|
|---|
| 18 |
|
|---|
| 19 | b.data = data;
|
|---|
| 20 | b.length = 1;
|
|---|
| 21 | ndr = ndr_pull_init_blob(&b, mem_ctx, NULL);
|
|---|
| 22 |
|
|---|
| 23 | if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_uint8(ndr, NDR_SCALARS, &result)))
|
|---|
| 24 | return 1;
|
|---|
| 25 |
|
|---|
| 26 | if (result != 0x02)
|
|---|
| 27 | return 2;
|
|---|
| 28 | ");
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.