summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_array.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-21 23:17:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:17 -0500
commitefc03df292aa84edb592c22191dbf86cdf8c32d0 (patch)
tree8a72f715ced0922effaa6dc48000bb1b48b82678 /source4/pidl/tests/ndr_array.pl
parent6e388c27d86d77f2c7f9414fbb152c246ca53022 (diff)
downloadsamba-efc03df292aa84edb592c22191dbf86cdf8c32d0.tar.gz
samba-efc03df292aa84edb592c22191dbf86cdf8c32d0.tar.bz2
samba-efc03df292aa84edb592c22191dbf86cdf8c32d0.zip
r9459: Move pidl up one level (to prevent too much nesting)
(This used to be commit e48202275e60c18e464457d200daeb953386e221)
Diffstat (limited to 'source4/pidl/tests/ndr_array.pl')
-rwxr-xr-xsource4/pidl/tests/ndr_array.pl45
1 files changed, 45 insertions, 0 deletions
diff --git a/source4/pidl/tests/ndr_array.pl b/source4/pidl/tests/ndr_array.pl
new file mode 100755
index 0000000000..d486308339
--- /dev/null
+++ b/source4/pidl/tests/ndr_array.pl
@@ -0,0 +1,45 @@
+#!/usr/bin/perl
+# Array testing
+# (C) 2005 Jelmer Vernooij <jelmer@samba.org>
+# Published under the GNU General Public License
+use strict;
+
+use Parse::Pidl::Test;
+
+my %settings = Parse::Pidl::Test::GetSettings(@ARGV);
+$settings{'IDL-Arguments'} = ['--quiet', '--parse', '--parser=ndr_test.c', '--header=ndr_test.h'];
+$settings{'IncludeFiles'} = ['ndr_test.h'];
+$settings{'ExtraFiles'} = ['ndr_test.c'];
+
+Parse::Pidl::Test::test_idl(
+ # Name
+ 'Fixed-Array',
+
+ # Settings
+ \%settings,
+
+ # IDL
+ '[public] void Test([in] uint8 x[10]);',
+
+ # C Test
+ '
+ uint8_t data[] = {1,2,3,4,5,6,7,8,9,10};
+ int i;
+ DATA_BLOB b;
+ struct ndr_pull *ndr;
+ struct Test r;
+
+ b.data = data;
+ b.length = 10;
+ ndr = ndr_pull_init_blob(&b, mem_ctx);
+
+ if (NT_STATUS_IS_ERR(ndr_pull_Test(ndr, NDR_IN, &r)))
+ return 1;
+
+ if (ndr->offset != 10)
+ return 2;
+
+ for (i = 0; i < 10; i++) {
+ if (r.in.x[i] != i+1) return 3;
+ }
+');