[PATCH 2/7] wlanapi/tests: Add test structure

Bruno Jesus 00cpxxx at gmail.com
Mon Jan 30 00:59:39 CST 2017


>From now on you should test with real WIRELESS hardware, testbot will always skip all tests.

Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
---
 configure.ac                   |  3 ++-
 dlls/wlanapi/Makefile.in       |  4 +++-
 dlls/wlanapi/tests/Makefile.in |  5 +++++
 dlls/wlanapi/tests/wlanapi.c   | 39 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 49 insertions(+), 2 deletions(-)
 create mode 100644 dlls/wlanapi/tests/Makefile.in
 create mode 100644 dlls/wlanapi/tests/wlanapi.c

diff --git a/configure.ac b/configure.ac
index d30dd9c..6e4cd8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3488,7 +3488,8 @@ WINE_CONFIG_DLL(wintab32,,[implib])
 WINE_CONFIG_TEST(dlls/wintab32/tests)
 WINE_CONFIG_DLL(wintrust,,[implib])
 WINE_CONFIG_TEST(dlls/wintrust/tests)
-WINE_CONFIG_DLL(wlanapi)
+WINE_CONFIG_DLL(wlanapi,,[implib])
+WINE_CONFIG_TEST(dlls/wlanapi/tests)
 WINE_CONFIG_DLL(wldap32,,[clean,implib])
 WINE_CONFIG_TEST(dlls/wldap32/tests)
 WINE_CONFIG_DLL(wmasf)
diff --git a/dlls/wlanapi/Makefile.in b/dlls/wlanapi/Makefile.in
index a0a06b9..b19c983 100644
--- a/dlls/wlanapi/Makefile.in
+++ b/dlls/wlanapi/Makefile.in
@@ -1,4 +1,6 @@
-MODULE = wlanapi.dll
+MODULE    = wlanapi.dll
+IMPORTLIB = wlanapi
+
 
 C_SRCS = \
 	main.c
diff --git a/dlls/wlanapi/tests/Makefile.in b/dlls/wlanapi/tests/Makefile.in
new file mode 100644
index 0000000..a08db32
--- /dev/null
+++ b/dlls/wlanapi/tests/Makefile.in
@@ -0,0 +1,5 @@
+TESTDLL   = wlanapi.dll
+IMPORTS   = wlanapi
+
+C_SRCS = \
+	wlanapi.c
diff --git a/dlls/wlanapi/tests/wlanapi.c b/dlls/wlanapi/tests/wlanapi.c
new file mode 100644
index 0000000..1c983b8
--- /dev/null
+++ b/dlls/wlanapi/tests/wlanapi.c
@@ -0,0 +1,39 @@
+/*
+ * Unit test suite for wlanapi functions
+ *
+ * Copyright 2017 Bruno Jesus
+ *
+ * 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
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <wlanapi.h>
+
+#include "wine/test.h"
+
+START_TEST(wlanapi)
+{
+  HANDLE handle;
+  DWORD neg_version;
+
+  /* Windows checks the service before validating the client version so this
+   * call will always result in error, no need to free the handle. */
+  if (WlanOpenHandle(0, NULL, &neg_version, &handle) == ERROR_SERVICE_NOT_ACTIVE)
+  {
+      win_skip("No wireless service running\n");
+      return;
+  }
+}
-- 
2.9.3




More information about the wine-patches mailing list