~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to pidl/tests/ndr_simple.pl

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
");