Alistair Leslie-Hughes : hnetcfg/tests: Add IUPnPNAT interface tests.

Alexandre Julliard julliard at winehq.org
Tue Oct 16 15:53:06 CDT 2018


Module: wine
Branch: master
Commit: 6670048908220ae2b2fe62584714273e2c1a8e1d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6670048908220ae2b2fe62584714273e2c1a8e1d

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Sun Oct 14 23:27:09 2018 +0000

hnetcfg/tests: Add IUPnPNAT interface tests.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/hnetcfg/tests/policy.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/dlls/hnetcfg/tests/policy.c b/dlls/hnetcfg/tests/policy.c
index 208f583..61175f9 100644
--- a/dlls/hnetcfg/tests/policy.c
+++ b/dlls/hnetcfg/tests/policy.c
@@ -27,6 +27,7 @@
 #include "wine/test.h"
 
 #include "netfw.h"
+#include "natupnp.h"
 
 static void test_policy2_rules(INetFwPolicy2 *policy2)
 {
@@ -160,6 +161,35 @@ static void test_NetFwAuthorizedApplication(void)
     INetFwAuthorizedApplication_Release(app);
 }
 
+static void test_IUPnPNAT(void)
+{
+    IUPnPNAT *nat;
+    IStaticPortMappingCollection *static_ports;
+    IDynamicPortMappingCollection *dync_ports;
+    INATEventManager *manager;
+    HRESULT hr;
+
+    hr = CoCreateInstance(&CLSID_UPnPNAT, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IUPnPNAT, (void**)&nat);
+    ok(hr == S_OK, "got: %08x\n", hr);
+
+    hr = IUPnPNAT_get_StaticPortMappingCollection(nat, &static_ports);
+    todo_wine ok(hr == S_OK, "got: %08x\n", hr);
+    if(hr == S_OK && static_ports)
+        IStaticPortMappingCollection_Release(static_ports);
+
+    hr = IUPnPNAT_get_DynamicPortMappingCollection(nat, &dync_ports);
+    ok(hr == S_OK || hr == E_NOTIMPL /* Windows 8.1 */, "got: %08x\n", hr);
+    if(hr == S_OK && dync_ports)
+        IDynamicPortMappingCollection_Release(dync_ports);
+
+    hr = IUPnPNAT_get_NATEventManager(nat, &manager);
+    todo_wine ok(hr == S_OK, "got: %08x\n", hr);
+    if(hr == S_OK && manager)
+        INATEventManager_Release(manager);
+
+    IUPnPNAT_Release(nat);
+}
+
 START_TEST(policy)
 {
     INetFwMgr *manager;
@@ -180,6 +210,7 @@ START_TEST(policy)
 
     test_interfaces();
     test_NetFwAuthorizedApplication();
+    test_IUPnPNAT();
 
     CoUninitialize();
 }




More information about the wine-cvs mailing list