r19868: Fix more tests.
[jra/samba/.git] / source4 / pidl / tests / ndr_simple.pl
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/../lib";
10 use lib "$RealBin";
11 use Util qw(test_samba4_ndr);
12
13 test_samba4_ndr("simple", "void Test(); ", 
14 "
15         uint8_t data[] = { 0x02 };
16         uint8_t result;
17         DATA_BLOB b;
18         struct ndr_pull *ndr;
19  
20         b.data = data;
21         b.length = 1;
22         ndr = ndr_pull_init_blob(&b, mem_ctx);
23  
24         if (NT_STATUS_IS_ERR(ndr_pull_uint8(ndr, NDR_SCALARS, &result)))
25                 return 1;
26  
27         if (result != 0x02) 
28                 return 2;
29 ");