[2/2] rpcrt4: Add a test for the ncalrpc protocol sequence.

Hans Leidekker hans at codeweavers.com
Wed Nov 4 02:10:50 CST 2009


---
 dlls/rpcrt4/tests/server.c |   27 ++++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 34ef797..63614e3 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -1291,6 +1291,20 @@ client(const char *test)
     ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
     ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
   }
+  else if (strcmp(test, "ncalrpc_basic") == 0)
+  {
+    static unsigned char ncalrpc[] = "ncalrpc";
+    static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
+    unsigned char *binding;
+
+    ok(RPC_S_OK == RpcStringBindingCompose(NULL, ncalrpc, NULL, guid, NULL, &binding), "RpcStringBindingCompose\n");
+    ok(RPC_S_OK == RpcBindingFromStringBinding(binding, &IServer_IfHandle), "RpcBindingFromStringBinding\n");
+
+    run_tests();
+
+    ok(RPC_S_OK == RpcStringFree(&binding), "RpcStringFree\n");
+    ok(RPC_S_OK == RpcBindingFree(&IServer_IfHandle), "RpcBindingFree\n");
+  }
   else if (strcmp(test, "np_basic") == 0)
   {
     static unsigned char np[] = "ncacn_np";
@@ -1316,11 +1330,17 @@ server(void)
   static unsigned char port[] = PORT;
   static unsigned char np[] = "ncacn_np";
   static unsigned char pipe[] = PIPE;
-  RPC_STATUS status, iptcp_status, np_status;
+  static unsigned char ncalrpc[] = "ncalrpc";
+  static unsigned char guid[] = "00000000-4114-0704-2301-000000000000";
+  RPC_STATUS status, iptcp_status, np_status, ncalrpc_status;
   DWORD ret;
 
   iptcp_status = RpcServerUseProtseqEp(iptcp, 20, port, NULL);
   ok(iptcp_status == RPC_S_OK, "RpcServerUseProtseqEp(ncacn_ip_tcp) failed with status %d\n", iptcp_status);
+
+  ncalrpc_status = RpcServerUseProtseqEp(ncalrpc, 0, guid, NULL);
+  ok(ncalrpc_status == RPC_S_OK, "RpcServerUseProtseqEp(ncalrpc) failed with status %d\n", ncalrpc_status);
+
   np_status = RpcServerUseProtseqEp(np, 0, pipe, NULL);
   if (np_status == RPC_S_PROTSEQ_NOT_SUPPORTED)
     skip("Protocol sequence ncacn_np is not supported\n");
@@ -1347,6 +1367,11 @@ server(void)
   else
     skip("tcp_basic tests skipped due to earlier failure\n");
 
+  if (ncalrpc_status == RPC_S_OK)
+    run_client("ncalrpc_basic");
+  else
+    skip("ncalrpc_basic tests skipped due to earlier failure\n");
+
   if (np_status == RPC_S_OK)
     run_client("np_basic");
   else
-- 
1.6.3.3




More information about the wine-patches mailing list