From 5c6d424c26c093ba9872f3e397a7fb8a7743072d Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Mon, 16 Mar 2009 12:15:02 +0000 Subject: [PATCH] add some wlanapi tests svn path=/trunk/; revision=40057 --- rostests/winetests/directory.rbuild | 3 + rostests/winetests/wlanapi/testlist.c | 15 +++++ rostests/winetests/wlanapi/wlanapi.c | 82 +++++++++++++++++++++++ rostests/winetests/wlanapi/wlanapi.rbuild | 15 +++++ 4 files changed, 115 insertions(+) create mode 100644 rostests/winetests/wlanapi/testlist.c create mode 100644 rostests/winetests/wlanapi/wlanapi.c create mode 100644 rostests/winetests/wlanapi/wlanapi.rbuild diff --git a/rostests/winetests/directory.rbuild b/rostests/winetests/directory.rbuild index 7b10d966b2f..5cff979e88c 100644 --- a/rostests/winetests/directory.rbuild +++ b/rostests/winetests/directory.rbuild @@ -232,6 +232,9 @@ + + + diff --git a/rostests/winetests/wlanapi/testlist.c b/rostests/winetests/wlanapi/testlist.c new file mode 100644 index 00000000000..b5ff645ba27 --- /dev/null +++ b/rostests/winetests/wlanapi/testlist.c @@ -0,0 +1,15 @@ +/* Automatically generated file; DO NOT EDIT!! */ + +#define WIN32_LEAN_AND_MEAN +#include + +#define STANDALONE +#include "wine/test.h" + +extern void func_wlanapi(void); + +const struct test winetest_testlist[] = +{ + { "wlanapi", func_wlanapi }, + { 0, 0 } +}; diff --git a/rostests/winetests/wlanapi/wlanapi.c b/rostests/winetests/wlanapi/wlanapi.c new file mode 100644 index 00000000000..dc578fd0a63 --- /dev/null +++ b/rostests/winetests/wlanapi/wlanapi.c @@ -0,0 +1,82 @@ +/* + * Wlanapi - tests + * + * Copyright 2009 Christoph von Wittich + * + * 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 +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wlanapi.h" + +#include "wine/test.h" + +static void WlanOpenHandle_test(void) +{ + DWORD ret; + DWORD dwNegotiatedVersion; + HANDLE hClientHandle; + + /* correct call to determine if WlanSvc is running */ + ret = WlanOpenHandle(1, NULL, &dwNegotiatedVersion, &hClientHandle); + if (ret == ERROR_SERVICE_EXISTS) + { + skip("Skipping wlanapi tests, WlanSvc is not running\n"); + return; + } + ok(ret == ERROR_SUCCESS, "WlanOpenHandle failed, error %d\n", ret); + WlanCloseHandle(hClientHandle, NULL); + + /* invalid pdwNegotiatedVersion */ + ret = WlanOpenHandle(1, NULL, NULL, &hClientHandle); + ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n"); + + /* invalid hClientHandle */ + ret = WlanOpenHandle(1, NULL, &dwNegotiatedVersion, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n"); + + /* invalid pReserved */ + ret = WlanOpenHandle(1, (PVOID) 1, &dwNegotiatedVersion, &hClientHandle); + ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n"); +} + +static void WlanCloseHandle_test(void) +{ + DWORD ret; + HANDLE hClientHandle = (HANDLE) 0xdeadbeef; + + /* invalid pReserved */ + ret = WlanCloseHandle(hClientHandle, (PVOID) 1); + ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n"); + + /* invalid hClientHandle */ + ret = WlanCloseHandle(NULL, NULL); + ok(ret == ERROR_INVALID_PARAMETER, "expected failure\n"); + + /* invalid hClientHandle */ + ret = WlanCloseHandle(hClientHandle, NULL); + ok(ret == ERROR_INVALID_HANDLE, "expected failure\n"); +} + +START_TEST(wlanapi) +{ + WlanOpenHandle_test(); + WlanCloseHandle_test(); +} diff --git a/rostests/winetests/wlanapi/wlanapi.rbuild b/rostests/winetests/wlanapi/wlanapi.rbuild new file mode 100644 index 00000000000..50bb8b98943 --- /dev/null +++ b/rostests/winetests/wlanapi/wlanapi.rbuild @@ -0,0 +1,15 @@ + + + + + -Wno-format + . + + wine + wlanapi + kernel32 + ntdll + wlanapi.c + testlist.c + +