Module: wine Branch: master Commit: 3052c700682ef2dc176b47fac883367f7ea422a8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3052c700682ef2dc176b47fac8...
Author: Bruno Jesus 00cpxxx@gmail.com Date: Mon Jan 30 04:59:39 2017 -0200
wlanapi/tests: Add test structure.
Signed-off-by: Bruno Jesus 00cpxxx@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
configure | 3 ++- configure.ac | 3 ++- dlls/wlanapi/Makefile.in | 3 ++- dlls/wlanapi/tests/Makefile.in | 5 +++++ dlls/wlanapi/tests/wlanapi.c | 39 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 50 insertions(+), 3 deletions(-)
diff --git a/configure b/configure index 6368926..68a79c0 100755 --- a/configure +++ b/configure @@ -18429,7 +18429,8 @@ wine_fn_config_dll wintab32 enable_wintab32 implib wine_fn_config_test dlls/wintab32/tests wintab32_test wine_fn_config_dll wintrust enable_wintrust implib wine_fn_config_test dlls/wintrust/tests wintrust_test -wine_fn_config_dll wlanapi enable_wlanapi +wine_fn_config_dll wlanapi enable_wlanapi implib +wine_fn_config_test dlls/wlanapi/tests wlanapi_test wine_fn_config_dll wldap32 enable_wldap32 clean,implib wine_fn_config_test dlls/wldap32/tests wldap32_test wine_fn_config_dll wmasf enable_wmasf 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..1f4b294 100644 --- a/dlls/wlanapi/Makefile.in +++ b/dlls/wlanapi/Makefile.in @@ -1,4 +1,5 @@ -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..3e6ac7a --- /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; + } +}