summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_alloc.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:51:13 +0200
commit5209a846a9157e649fcdcb561f7eaf19c8c0e465 (patch)
treeb0a7e52b5646c8eec182dbc391e7934b6804488c /source4/pidl/tests/ndr_alloc.pl
parent625359b2e266105022309df8985720108ecd6f67 (diff)
parent2ee8d29d22bcb1c350ab59d71b0aee548489bc9c (diff)
downloadsamba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.gz
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.tar.bz2
samba-5209a846a9157e649fcdcb561f7eaf19c8c0e465.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into regsrv
Conflicts: source4/lib/registry/ldb.c source4/rpc_server/winreg/rpc_winreg.c
Diffstat (limited to 'source4/pidl/tests/ndr_alloc.pl')
-rwxr-xr-xsource4/pidl/tests/ndr_alloc.pl118
1 files changed, 0 insertions, 118 deletions
diff --git a/source4/pidl/tests/ndr_alloc.pl b/source4/pidl/tests/ndr_alloc.pl
deleted file mode 100755
index 399fbd21d6..0000000000
--- a/source4/pidl/tests/ndr_alloc.pl
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/perl
-# NDR allocation tests
-# (C) 2005 Jelmer Vernooij. Published under the GNU GPL
-use strict;
-
-use Test::More tests => 5 * 8;
-use FindBin qw($RealBin);
-use lib "$RealBin";
-use Util qw(test_samba4_ndr);
-
-# Check that an outgoing scalar pointer is allocated correctly
-
-test_samba4_ndr("alloc-scalar",
-'
- typedef struct {
- uint8 *x;
- } bla;
-
- [public] void TestAlloc([in] bla foo);
-','
- uint8_t data[] = { 0xde, 0xad, 0xbe, 0xef, 0x03 };
- DATA_BLOB b = { data, 5 };
- struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, NULL);
- struct TestAlloc r;
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
- return 1;
-
- if (r.in.foo.x == NULL)
- return 2;
-
- if (*r.in.foo.x != 0x03)
- return 3;
-'
-);
-
-# Check that an outgoing buffer pointer is allocated correctly
-test_samba4_ndr("alloc-buffer",
-'
- typedef struct { uint8 data; } blie;
- typedef struct { blie *x; } bla;
-
- [public] void TestAlloc([in] bla foo);
-','
- uint8_t data[] = { 0xde, 0xad, 0xbe, 0xef, 0x03 };
- DATA_BLOB b = { data, 5 };
- struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, NULL);
- struct TestAlloc r;
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
- return 1;
-
- if (r.in.foo.x == NULL)
- return 2;
-
- if (r.in.foo.x->data != 0x03)
- return 3;
-'
-);
-
-# Check that ref pointers aren't allocated by default
-test_samba4_ndr("ref-noalloc-null",
-'
- [public] void TestAlloc([in,ref] uint8 *t);
-','
- uint8_t data[] = { 0x03 };
- DATA_BLOB b = { data, 1 };
- struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, NULL);
- struct TestAlloc r;
- r.in.t = NULL;
-
- if (NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
- return 1;
-'
-);
-
-# Check that ref pointers aren't allocated by default
-test_samba4_ndr("ref-noalloc",
-'
- [public] void TestAlloc([in,ref] uint8 *t);
-','
- uint8_t data[] = { 0x03 };
- DATA_BLOB b = { data, 1 };
- struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, NULL);
- struct TestAlloc r;
- uint8_t x;
- r.in.t = &x;
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
- return 1;
-
- if (*r.in.t != 0x03)
- return 2;
-'
-);
-
-# Check that an outgoing ref pointer is allocated correctly
-test_samba4_ndr("ref-alloc",
-'
- [public] void TestAlloc([in,ref] uint8 *t);
-','
- uint8_t data[] = { 0x03 };
- DATA_BLOB b = { data, 1 };
- struct ndr_pull *ndr = ndr_pull_init_blob(&b, NULL, NULL);
- struct TestAlloc r;
- ndr->flags |= LIBNDR_FLAG_REF_ALLOC;
- r.in.t = NULL;
-
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_pull_TestAlloc(ndr, NDR_IN, &r)))
- return 1;
-
- if (r.in.t == NULL)
- return 2;
-
- if (*r.in.t != 0x03)
- return 3;
-'
-);