summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_represent.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-24 01:03:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:59:08 -0500
commitb6cae24de839756db87a62213795856c0051b8b9 (patch)
tree2020f5b9f45acf2b0208db86e833e2bd158be576 /source4/pidl/tests/ndr_represent.pl
parent311d6f47c85282925932b3a7326e66679be9451f (diff)
downloadsamba-b6cae24de839756db87a62213795856c0051b8b9.tar.gz
samba-b6cae24de839756db87a62213795856c0051b8b9.tar.bz2
samba-b6cae24de839756db87a62213795856c0051b8b9.zip
r14687: Start working on support for represent_as() and transmit_as() as
an alternative to subcontext() (This used to be commit 744402160d5f994f5440553bb726e95a13033a83)
Diffstat (limited to 'source4/pidl/tests/ndr_represent.pl')
-rw-r--r--source4/pidl/tests/ndr_represent.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/source4/pidl/tests/ndr_represent.pl b/source4/pidl/tests/ndr_represent.pl
new file mode 100644
index 0000000000..772df2b94e
--- /dev/null
+++ b/source4/pidl/tests/ndr_represent.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/perl
+# NDR represent_as() / transmit_as() tests
+# (C) 2006 Jelmer Vernooij. Published under the GNU GPL
+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);
+
+SKIP: {
+ skip "represent_as() is not finished yet", 8;
+
+test_samba4_ndr('represent_as-simple',
+'
+ void bla([in,represent_as(foo)] uint8 x);
+',
+'
+ uint8_t expected[] = { 0x0D };
+ DATA_BLOB in_blob = { expected, 1 };
+ struct ndr_pull *ndr = ndr_pull_init_blob(&in_blob, NULL);
+ struct bla r;
+
+ if (NT_STATUS_IS_ERR(ndr_pull_bla(ndr, NDR_SCALARS|NDR_BUFFERS, &r)))
+ return 1;
+
+ if (r != 13)
+ return 2;
+',
+'
+NTSTATUS ndr_uint8_to_foo(uint8 from, foo *to)
+{
+ *to = from;
+ return NT_STATUS_OK;
+}
+'
+);
+
+}