Hans Leidekker : netprofm: Add a couple of tests for INetworkListManager.

Alexandre Julliard julliard at winehq.org
Mon Apr 7 13:20:07 CDT 2014


Module: wine
Branch: master
Commit: 3b63733bcbad751763d6f7a067d96aa2bb789152
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3b63733bcbad751763d6f7a067d96aa2bb789152

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Apr  7 14:58:48 2014 +0200

netprofm: Add a couple of tests for INetworkListManager.

---

 configure                       |    1 +
 configure.ac                    |    1 +
 dlls/netprofm/tests/Makefile.in |    5 +++
 dlls/netprofm/tests/list.c      |   66 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+)

diff --git a/configure b/configure
index ceae545..fae5c0a 100755
--- a/configure
+++ b/configure
@@ -17054,6 +17054,7 @@ wine_fn_config_test dlls/netapi32/tests netapi32_test
 wine_fn_config_dll netcfgx enable_netcfgx clean
 wine_fn_config_test dlls/netcfgx/tests netcfgx_test
 wine_fn_config_dll netprofm enable_netprofm clean
+wine_fn_config_test dlls/netprofm/tests netprofm_test
 wine_fn_config_dll newdev enable_newdev implib
 wine_fn_config_dll normaliz enable_normaliz implib
 wine_fn_config_dll npmshtml enable_npmshtml
diff --git a/configure.ac b/configure.ac
index 3a70159..7e463b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3032,6 +3032,7 @@ WINE_CONFIG_TEST(dlls/netapi32/tests)
 WINE_CONFIG_DLL(netcfgx,,[clean])
 WINE_CONFIG_TEST(dlls/netcfgx/tests)
 WINE_CONFIG_DLL(netprofm,,[clean])
+WINE_CONFIG_TEST(dlls/netprofm/tests)
 WINE_CONFIG_DLL(newdev,,[implib])
 WINE_CONFIG_DLL(normaliz,,[implib])
 WINE_CONFIG_DLL(npmshtml)
diff --git a/dlls/netprofm/tests/Makefile.in b/dlls/netprofm/tests/Makefile.in
new file mode 100644
index 0000000..45b8809
--- /dev/null
+++ b/dlls/netprofm/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL   = netprofm.dll
+IMPORTS   = ole32
+
+C_SRCS = \
+	list.c
diff --git a/dlls/netprofm/tests/list.c b/dlls/netprofm/tests/list.c
new file mode 100644
index 0000000..9ac427e
--- /dev/null
+++ b/dlls/netprofm/tests/list.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2014 Hans Leidekker for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdio.h>
+#include "windows.h"
+#define COBJMACROS
+#include "initguid.h"
+#include "objbase.h"
+#include "netlistmgr.h"
+#include "wine/test.h"
+
+static void test_INetworkListManager( void )
+{
+    INetworkListManager *mgr;
+    NLM_CONNECTIVITY connectivity;
+    VARIANT_BOOL connected;
+    HRESULT hr;
+
+    hr = CoCreateInstance( &CLSID_NetworkListManager, NULL, CLSCTX_INPROC_SERVER,
+                           &IID_INetworkListManager, (void **)&mgr );
+    if (hr != S_OK)
+    {
+        win_skip( "can't create instance of NetworkListManager\n" );
+        return;
+    }
+
+    connectivity = 0xdeadbeef;
+    hr = INetworkListManager_GetConnectivity( mgr, &connectivity );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( connectivity != 0xdeadbeef, "unchanged value\n" );
+    trace( "GetConnectivity: %08x\n", connectivity );
+
+    connected = 0xdead;
+    hr = INetworkListManager_IsConnected( mgr, &connected );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" );
+
+    connected = 0xdead;
+    hr = INetworkListManager_IsConnectedToInternet( mgr, &connected );
+    ok( hr == S_OK, "got %08x\n", hr );
+    ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" );
+
+    INetworkListManager_Release( mgr );
+}
+
+START_TEST( list )
+{
+    CoInitialize( NULL );
+    test_INetworkListManager();
+    CoUninitialize();
+}




More information about the wine-cvs mailing list