From b59c53fbffc1519d55224ad294c26d9148296cf0 Mon Sep 17 00:00:00 2001
From: Colin Finck <mail@colinfinck.de>
Date: Fri, 19 Aug 2016 11:52:58 +0200
Subject: [PATCH] rpcrt4: Add a test for RpcBindingServerFromClient
 (todo_wine).

Signed-off-by: Colin Finck <mail@colinfinck.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 dlls/rpcrt4/tests/server.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 0b31d3dad81..2653f7ad470 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -744,6 +744,35 @@ void __cdecl s_context_handle_test(void)
 
         pNDRSContextUnmarshall2(binding, buf, NDR_LOCAL_DATA_REPRESENTATION, &server_if2.InterfaceId, 0);
     }
+
+    binding = NULL;
+    status = RpcBindingServerFromClient(NULL, &binding);
+
+    todo_wine
+    {
+        ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+        ok(binding != NULL, "binding is NULL\n");
+    }
+
+    if (status == RPC_S_OK && binding != NULL)
+    {
+        unsigned char* string_binding = NULL;
+        unsigned char* computer_name = NULL;
+
+        status = RpcBindingToStringBindingA(binding, &string_binding);
+
+        ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+        ok(string_binding != NULL, "string_binding is NULL\n");
+
+        status = RpcStringBindingParseA(string_binding, NULL, NULL, &computer_name, NULL, NULL);
+
+        ok(status == RPC_S_OK, "expected RPC_S_OK got %u\n", status);
+        ok(computer_name != NULL, "computer_name is NULL\n");
+
+        RpcStringFreeA(&string_binding);
+        RpcStringFreeA(&computer_name);
+        RpcBindingFree(&binding);
+    }
 }
 
 void __cdecl s_get_numbers(int length, int size, pints_t n[])
-- 
GitLab