aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pidl/tests/ndr_represent.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pidl/tests/ndr_represent.pl')
-rw-r--r--tools/pidl/tests/ndr_represent.pl37
1 files changed, 35 insertions, 2 deletions
diff --git a/tools/pidl/tests/ndr_represent.pl b/tools/pidl/tests/ndr_represent.pl
index 93764451cf..52cd06f817 100644
--- a/tools/pidl/tests/ndr_represent.pl
+++ b/tools/pidl/tests/ndr_represent.pl
@@ -3,9 +3,8 @@
# (C) 2006 Jelmer Vernooij. Published under the GNU GPL
use strict;
-use Test::More tests => 1 * 8;
+use Test::More tests => 2 * 8;
use FindBin qw($RealBin);
-use lib "$RealBin/../lib";
use lib "$RealBin";
use Util qw(test_samba4_ndr);
@@ -41,3 +40,37 @@ NTSTATUS ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
}
'
);
+
+test_samba4_ndr('transmit_as-simple',
+'
+ void bla([in,transmit_as(uint32)] 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.in.x != 13)
+ return 2;
+',
+'
+#include <libcli/util/nterr.h>
+
+NTSTATUS ndr_uint8_to_uint32(uint8_t from, uint32_t *to)
+{
+ *to = from;
+ return NT_STATUS_OK;
+}
+
+NTSTATUS ndr_uint32_to_uint8(uint32_t from, uint8_t *to)
+{
+ *to = from;
+ return NT_STATUS_OK;
+}
+'
+);
+