svn commit: samba r26262 - in branches/SAMBA_4_0: . source/pidl/tests

jelmer at samba.org jelmer at samba.org
Mon Dec 3 17:51:50 GMT 2007


Author: jelmer
Date: 2007-12-03 17:51:50 +0000 (Mon, 03 Dec 2007)
New Revision: 26262

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26262

Log:
Add test for WERROR return code handling for Samba 3 client code.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/pidl/tests/samba3-cli.pl


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/pidl/tests/samba3-cli.pl
===================================================================
--- branches/SAMBA_4_0/source/pidl/tests/samba3-cli.pl	2007-12-03 17:51:44 UTC (rev 26261)
+++ branches/SAMBA_4_0/source/pidl/tests/samba3-cli.pl	2007-12-03 17:51:50 UTC (rev 26262)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 7;
+use Test::More tests => 8;
 use FindBin qw($RealBin);
 use lib "$RealBin";
 use Util;
@@ -59,3 +59,42 @@
 }
 
 ");
+
+$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)
+{
+\tstruct bar r;
+\tNTSTATUS status;
+\t
+\t/* In parameters */
+\t
+\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
+\tif (!NT_STATUS_IS_OK(status)) {
+\t\treturn status;
+\t}
+\t
+\tif (DEBUGLEVEL >= 10)
+\t\tNDR_PRINT_OUT_DEBUG(bar, &r);
+\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);
+}
+
+");



More information about the samba-cvs mailing list