summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/ndr_refptr.pl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-25 03:04:13 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:43 -0500
commit7717f180ca2f908e1b3258355520719991215050 (patch)
treecca55b2debbe63fdf39d6810ad7987af28ffc04a /source4/pidl/tests/ndr_refptr.pl
parent620d375320e143abcf6775a392f9bde3146f2baa (diff)
downloadsamba-7717f180ca2f908e1b3258355520719991215050.tar.gz
samba-7717f180ca2f908e1b3258355520719991215050.tar.bz2
samba-7717f180ca2f908e1b3258355520719991215050.zip
r12470: Add helper module for pidl tests
Convert other pidl tests to use Test::More and run them from 'make test' (This used to be commit 3a57d29a62112ab654e290ccc985fba7f67664c5)
Diffstat (limited to 'source4/pidl/tests/ndr_refptr.pl')
-rwxr-xr-xsource4/pidl/tests/ndr_refptr.pl81
1 files changed, 43 insertions, 38 deletions
diff --git a/source4/pidl/tests/ndr_refptr.pl b/source4/pidl/tests/ndr_refptr.pl
index 46d74f9b1e..0fd573d51e 100755
--- a/source4/pidl/tests/ndr_refptr.pl
+++ b/source4/pidl/tests/ndr_refptr.pl
@@ -5,9 +5,13 @@
# Published under the GNU General Public License.
use strict;
-use Test::Simple tests => 1;
+use Test::More tests => 21 * 8;
+use FindBin qw($RealBin);
+use lib "$RealBin/../lib";
+use lib "$RealBin";
+use Util qw(test_samba4_ndr);
-Parse::Pidl::Test::test_idl("noptr-push", \%settings,
+test_samba4_ndr("noptr-push",
' typedef struct {
uint16 x;
} xstruct;
@@ -36,7 +40,7 @@ Parse::Pidl::Test::test_idl("noptr-push", \%settings,
}
');
-Parse::Pidl::Test::test_idl("ptr-embedded-push", \%settings,
+test_samba4_ndr("ptr-embedded-push",
' typedef struct {
uint16 *x;
} xstruct;
@@ -63,7 +67,7 @@ Parse::Pidl::Test::test_idl("ptr-embedded-push", \%settings,
return 4;
');
-Parse::Pidl::Test::test_idl("ptr-embedded-push-null", \%settings,
+test_samba4_ndr("ptr-embedded-push-null",
' typedef struct {
uint16 *x;
} xstruct;
@@ -86,7 +90,7 @@ Parse::Pidl::Test::test_idl("ptr-embedded-push-null", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("refptr-embedded-push", \%settings,
+test_samba4_ndr("refptr-embedded-push",
'
typedef struct {
[ref] uint16 *x;
@@ -114,7 +118,7 @@ Parse::Pidl::Test::test_idl("refptr-embedded-push", \%settings,
return 4;
');
-Parse::Pidl::Test::test_idl("refptr-embedded-push-null", \%settings,
+test_samba4_ndr("refptr-embedded-push-null",
'
typedef struct {
[ref] uint16 *x;
@@ -132,7 +136,7 @@ Parse::Pidl::Test::test_idl("refptr-embedded-push-null", \%settings,
/* Windows gives [client runtime error 0x6f4] */
');
-Parse::Pidl::Test::test_idl("ptr-top-push", \%settings,
+test_samba4_ndr("ptr-top-push",
'
typedef struct {
uint16 x;
@@ -157,7 +161,7 @@ Parse::Pidl::Test::test_idl("ptr-top-push", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("ptr-top-push-null", \%settings,
+test_samba4_ndr("ptr-top-push-null",
'
typedef struct {
uint16 x;
@@ -177,7 +181,7 @@ Parse::Pidl::Test::test_idl("ptr-top-push-null", \%settings,
');
-Parse::Pidl::Test::test_idl("refptr-top-push", \%settings,
+test_samba4_ndr("refptr-top-push",
'
typedef struct {
uint16 x;
@@ -202,7 +206,7 @@ Parse::Pidl::Test::test_idl("refptr-top-push", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("refptr-top-push-null", \%settings,
+test_samba4_ndr("refptr-top-push-null",
'
typedef struct {
uint16 x;
@@ -222,7 +226,7 @@ Parse::Pidl::Test::test_idl("refptr-top-push-null", \%settings,
');
-Parse::Pidl::Test::test_idl("uniqueptr-top-push", \%settings,
+test_samba4_ndr("uniqueptr-top-push",
' typedef struct {
uint16 x;
} xstruct;
@@ -250,7 +254,7 @@ Parse::Pidl::Test::test_idl("uniqueptr-top-push", \%settings,
return 4;
');
-Parse::Pidl::Test::test_idl("uniqueptr-top-push-null", \%settings,
+test_samba4_ndr("uniqueptr-top-push-null",
' typedef struct {
uint16 x;
} xstruct;
@@ -274,7 +278,7 @@ Parse::Pidl::Test::test_idl("uniqueptr-top-push-null", \%settings,
');
-Parse::Pidl::Test::test_idl("ptr-top-out-pull", \%settings,
+test_samba4_ndr("ptr-top-out-pull",
'
typedef struct {
uint16 x;
@@ -301,7 +305,7 @@ Parse::Pidl::Test::test_idl("ptr-top-out-pull", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("ptr-top-out-pull-null", \%settings,
+test_samba4_ndr("ptr-top-out-pull-null",
'
typedef struct {
uint16 x;
@@ -324,7 +328,7 @@ Parse::Pidl::Test::test_idl("ptr-top-out-pull-null", \%settings,
');
-Parse::Pidl::Test::test_idl("refptr-top-out-pull", \%settings,
+test_samba4_ndr("refptr-top-out-pull",
'
typedef struct {
uint16 x;
@@ -351,7 +355,7 @@ Parse::Pidl::Test::test_idl("refptr-top-out-pull", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("refptr-top-out-pull-null", \%settings,
+test_samba4_ndr("refptr-top-out-pull-null",
'
typedef struct {
uint16 x;
@@ -374,7 +378,7 @@ Parse::Pidl::Test::test_idl("refptr-top-out-pull-null", \%settings,
');
-Parse::Pidl::Test::test_idl("ptr-top-push-double", \%settings,
+test_samba4_ndr("ptr-top-push-double",
'
[public] void echo_TestRef([in] uint16 **foo);
',
@@ -398,7 +402,7 @@ Parse::Pidl::Test::test_idl("ptr-top-push-double", \%settings,
return 4;
');
-Parse::Pidl::Test::test_idl("ptr-top-push-double-sndnull", \%settings,
+test_samba4_ndr("ptr-top-push-double-sndnull",
'
[public] void echo_TestRef([in] uint16 **foo);
',
@@ -418,7 +422,7 @@ Parse::Pidl::Test::test_idl("ptr-top-push-double-sndnull", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("ptr-top-push-double-fstnull", \%settings,
+test_samba4_ndr("ptr-top-push-double-fstnull",
'
[public] void echo_TestRef([in] uint16 **foo);
',
@@ -434,7 +438,7 @@ Parse::Pidl::Test::test_idl("ptr-top-push-double-fstnull", \%settings,
');
-Parse::Pidl::Test::test_idl("refptr-top-push-double", \%settings,
+test_samba4_ndr("refptr-top-push-double",
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
@@ -458,7 +462,7 @@ Parse::Pidl::Test::test_idl("refptr-top-push-double", \%settings,
return 4;
');
-Parse::Pidl::Test::test_idl("refptr-top-push-double-sndnull", \%settings,
+test_samba4_ndr("refptr-top-push-double-sndnull",
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
@@ -478,7 +482,7 @@ Parse::Pidl::Test::test_idl("refptr-top-push-double-sndnull", \%settings,
return 3;
');
-Parse::Pidl::Test::test_idl("refptr-top-push-double-fstnull", \%settings,
+test_samba4_ndr("refptr-top-push-double-fstnull",
'
[public] void echo_TestRef([in,ref] uint16 **foo);
',
@@ -493,19 +497,20 @@ Parse::Pidl::Test::test_idl("refptr-top-push-double-fstnull", \%settings,
');
-Parse::Pidl::Test::test_idl("ignore-ptr", \%settings,
-'
- [public] void echo_TestRef([in,ignore] uint16 *foo, [in] uint16 *bar);
-',
-' struct ndr_push *ndr = ndr_push_init();
- struct echo_TestRef r;
- uint16_t v = 10;
- r.in.foo = &v;
- r.in.bar = &v;
-
- if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
- return 1;
-
- if (ndr->offset != 4)
- return 2;
-');
+#FIXME: Not supported yet
+#test_samba4_ndr("ignore-ptr",
+#'
+# [public] void echo_TestRef([in,ignore] uint16 *foo, [in] uint16 *bar);
+#',
+#' struct ndr_push *ndr = ndr_push_init();
+# struct echo_TestRef r;
+# uint16_t v = 10;
+# r.in.foo = &v;
+# r.in.bar = &v;
+#
+# if (NT_STATUS_IS_OK(ndr_push_echo_TestRef(ndr, NDR_IN, &r)))
+# return 1;
+#
+# if (ndr->offset != 4)
+# return 2;
+#');