summaryrefslogtreecommitdiff
path: root/source4/pidl/tests/samba3-cli.pl
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-01-11 09:25:14 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-01-11 09:25:14 +1100
commit80902a2a2b14bc27af0f195d18c40ccef9cb780c (patch)
tree792ae2b86096db9026933c7fe22c57ff7a401bf4 /source4/pidl/tests/samba3-cli.pl
parent7054ce65485482d1cc5fa4ff83272feb752e71c2 (diff)
parent84c9b6235ed52770eb6dfae8b75c346d435cb260 (diff)
downloadsamba-80902a2a2b14bc27af0f195d18c40ccef9cb780c.tar.gz
samba-80902a2a2b14bc27af0f195d18c40ccef9cb780c.tar.bz2
samba-80902a2a2b14bc27af0f195d18c40ccef9cb780c.zip
Merge commit 'origin/v4-0-test' into 4-0-local
(This used to be commit 4720f53a92644dd6959e18923924fbe01889111c)
Diffstat (limited to 'source4/pidl/tests/samba3-cli.pl')
-rwxr-xr-xsource4/pidl/tests/samba3-cli.pl69
1 files changed, 44 insertions, 25 deletions
diff --git a/source4/pidl/tests/samba3-cli.pl b/source4/pidl/tests/samba3-cli.pl
index 5086300e46..1b2a3c9785 100755
--- a/source4/pidl/tests/samba3-cli.pl
+++ b/source4/pidl/tests/samba3-cli.pl
@@ -29,31 +29,40 @@ my $x = new Parse::Pidl::Samba3::ClientNDR();
$fn = { NAME => "bar", ELEMENTS => [ ] };
$x->ParseFunction("foo", $fn);
-is($x->{res}, "NTSTATUS rpccli_bar(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx)
+is($x->{res},
+"NTSTATUS rpccli_bar(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx)
{
\tstruct bar r;
\tNTSTATUS status;
-\t
+
\t/* In parameters */
-\t
-\tif (DEBUGLEVEL >= 10)
+
+\tif (DEBUGLEVEL >= 10) {
\t\tNDR_PRINT_IN_DEBUG(bar, &r);
-\t
-\tstatus = cli_do_rpc_ndr(cli, mem_ctx, PI_FOO, &ndr_table_foo, NDR_BAR, &r);
-\t
+\t}
+
+ status = cli_do_rpc_ndr(cli,
+ mem_ctx,
+ PI_FOO,
+ &ndr_table_foo,
+ NDR_BAR,
+ &r);
+
\tif (!NT_STATUS_IS_OK(status)) {
\t\treturn status;
\t}
-\t
-\tif (DEBUGLEVEL >= 10)
+
+\tif (DEBUGLEVEL >= 10) {
\t\tNDR_PRINT_OUT_DEBUG(bar, &r);
-\t
+\t}
+
\tif (NT_STATUS_IS_ERR(status)) {
\t\treturn status;
\t}
-\t
+
\t/* Return variables */
-\t
+
\t/* Return result */
\treturn NT_STATUS_OK;
}
@@ -64,36 +73,46 @@ $x = new Parse::Pidl::Samba3::ClientNDR();
$fn = { NAME => "bar", ELEMENTS => [ ], RETURN_TYPE => "WERROR" };
$x->ParseFunction("foo", $fn);
-is($x->{res}, "NTSTATUS rpccli_bar(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, WERROR *werror)
+is($x->{res},
+"NTSTATUS rpccli_bar(struct rpc_pipe_client *cli,
+ TALLOC_CTX *mem_ctx,
+ WERROR *werror)
{
\tstruct bar r;
\tNTSTATUS status;
-\t
+
\t/* In parameters */
-\t
-\tif (DEBUGLEVEL >= 10)
+
+\tif (DEBUGLEVEL >= 10) {
\t\tNDR_PRINT_IN_DEBUG(bar, &r);
-\t
-\tstatus = cli_do_rpc_ndr(cli, mem_ctx, PI_FOO, &ndr_table_foo, NDR_BAR, &r);
-\t
+\t}
+
+ status = cli_do_rpc_ndr(cli,
+ mem_ctx,
+ PI_FOO,
+ &ndr_table_foo,
+ NDR_BAR,
+ &r);
+
\tif (!NT_STATUS_IS_OK(status)) {
\t\treturn status;
\t}
-\t
-\tif (DEBUGLEVEL >= 10)
+
+\tif (DEBUGLEVEL >= 10) {
\t\tNDR_PRINT_OUT_DEBUG(bar, &r);
-\t
+\t}
+
\tif (NT_STATUS_IS_ERR(status)) {
\t\treturn status;
\t}
-\t
+
\t/* Return variables */
-\t
+
\t/* Return result */
\tif (werror) {
\t\t*werror = r.out.result;
\t}
-\t
+
\treturn werror_to_ntstatus(r.out.result);
}