aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2006-12-10 18:55:24 +0000
committerJörg Mayer <jmayer@loplof.de>2006-12-10 18:55:24 +0000
commit0fcb8c46abf528cab390da564a8a38939067724c (patch)
tree88dd21cfeafcd61a6c3071808116bb082f0c330c /tools
parent34824cb310c3183442c7c4c67f84a39d86c8b7d0 (diff)
Forgot to add this file during one of the last commits.
svn path=/trunk/; revision=20101
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pidl/tests/ndr_fullptr.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/tools/pidl/tests/ndr_fullptr.pl b/tools/pidl/tests/ndr_fullptr.pl
new file mode 100755
index 0000000000..569f0060a3
--- /dev/null
+++ b/tools/pidl/tests/ndr_fullptr.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+# Simple tests for unique pointers
+# (C) 2006 Jelmer Vernooij <jelmer@samba.org>.
+# Published under the GNU General Public License.
+use strict;
+
+use Test::More tests => 1 * 8;
+use FindBin qw($RealBin);
+use lib "$RealBin/../lib";
+use lib "$RealBin";
+use Util qw(test_samba4_ndr);
+
+test_samba4_ndr("fullptr-push-dup",
+'
+ [public] uint16 echo_TestFull([in,ptr] uint32 *x, [in,ptr] uint32 *y);
+',
+'
+ struct ndr_push *ndr = ndr_push_init();
+ uint32_t v = 13;
+ struct echo_TestFull r;
+ r.in.x = &v;
+ r.in.y = &v;
+
+ if (NT_STATUS_IS_ERR(ndr_push_echo_TestFull(ndr, NDR_IN, &r))) {
+ fprintf(stderr, "push failed\n");
+ return 1;
+ }
+
+ if (ndr->offset != 12) {
+ fprintf(stderr, "Offset(%d) != 12\n", ndr->offset);
+ return 2;
+ }
+
+ if (ndr->data[0] != ndr->data[8] ||
+ ndr->data[1] != ndr->data[9] ||
+ ndr->data[2] != ndr->data[10] ||
+ ndr->data[3] != ndr->data[11]) {
+ fprintf(stderr, "Data incorrect\n");
+ return 3;
+ }
+');