rasapi32: Added some tests for RasEnumDevicesA (based on a patch by Austin English),
This commit is contained in:
parent
9e7deebcb8
commit
b8c6d8e598
|
@ -311,6 +311,7 @@ programs/winetest/psapi_test.exe
|
|||
programs/winetest/qedit_test.exe
|
||||
programs/winetest/qmgr_test.exe
|
||||
programs/winetest/quartz_test.exe
|
||||
programs/winetest/rasapi32_test.exe
|
||||
programs/winetest/riched20_test.exe
|
||||
programs/winetest/riched32_test.exe
|
||||
programs/winetest/rpcrt4_test.exe
|
||||
|
|
|
@ -407,6 +407,7 @@ ALL_MAKEFILES = \
|
|||
dlls/quartz/tests/Makefile \
|
||||
dlls/query/Makefile \
|
||||
dlls/rasapi32/Makefile \
|
||||
dlls/rasapi32/tests/Makefile \
|
||||
dlls/resutils/Makefile \
|
||||
dlls/riched20/Makefile \
|
||||
dlls/riched20/tests/Makefile \
|
||||
|
@ -835,6 +836,7 @@ dlls/quartz/Makefile: dlls/quartz/Makefile.in dlls/Makedll.rules
|
|||
dlls/quartz/tests/Makefile: dlls/quartz/tests/Makefile.in dlls/Maketest.rules
|
||||
dlls/query/Makefile: dlls/query/Makefile.in dlls/Makedll.rules
|
||||
dlls/rasapi32/Makefile: dlls/rasapi32/Makefile.in dlls/Makedll.rules
|
||||
dlls/rasapi32/tests/Makefile: dlls/rasapi32/tests/Makefile.in dlls/Maketest.rules
|
||||
dlls/resutils/Makefile: dlls/resutils/Makefile.in dlls/Makedll.rules
|
||||
dlls/riched20/Makefile: dlls/riched20/Makefile.in dlls/Makedll.rules
|
||||
dlls/riched20/tests/Makefile: dlls/riched20/tests/Makefile.in dlls/Maketest.rules
|
||||
|
|
|
@ -22183,6 +22183,8 @@ ac_config_files="$ac_config_files dlls/query/Makefile"
|
|||
|
||||
ac_config_files="$ac_config_files dlls/rasapi32/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files dlls/rasapi32/tests/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files dlls/resutils/Makefile"
|
||||
|
||||
ac_config_files="$ac_config_files dlls/riched20/Makefile"
|
||||
|
@ -23334,6 +23336,7 @@ do
|
|||
"dlls/quartz/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/quartz/tests/Makefile" ;;
|
||||
"dlls/query/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/query/Makefile" ;;
|
||||
"dlls/rasapi32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/rasapi32/Makefile" ;;
|
||||
"dlls/rasapi32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/rasapi32/tests/Makefile" ;;
|
||||
"dlls/resutils/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/resutils/Makefile" ;;
|
||||
"dlls/riched20/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/riched20/Makefile" ;;
|
||||
"dlls/riched20/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/riched20/tests/Makefile" ;;
|
||||
|
|
|
@ -1947,6 +1947,7 @@ AC_CONFIG_FILES([dlls/quartz/Makefile])
|
|||
AC_CONFIG_FILES([dlls/quartz/tests/Makefile])
|
||||
AC_CONFIG_FILES([dlls/query/Makefile])
|
||||
AC_CONFIG_FILES([dlls/rasapi32/Makefile])
|
||||
AC_CONFIG_FILES([dlls/rasapi32/tests/Makefile])
|
||||
AC_CONFIG_FILES([dlls/resutils/Makefile])
|
||||
AC_CONFIG_FILES([dlls/riched20/Makefile])
|
||||
AC_CONFIG_FILES([dlls/riched20/tests/Makefile])
|
||||
|
|
|
@ -342,6 +342,7 @@ TESTSUBDIRS = \
|
|||
qedit/tests \
|
||||
qmgr/tests \
|
||||
quartz/tests \
|
||||
rasapi32/tests \
|
||||
riched20/tests \
|
||||
riched32/tests \
|
||||
rpcrt4/tests \
|
||||
|
|
|
@ -245,6 +245,9 @@ DWORD WINAPI RasEnumAutodialAddressesW(LPWSTR *a, LPDWORD b, LPDWORD c)
|
|||
*/
|
||||
DWORD WINAPI RasEnumDevicesA(LPRASDEVINFOA lpRasDevinfo, LPDWORD lpcb, LPDWORD lpcDevices)
|
||||
{
|
||||
if (!lpcb || !lpcDevices)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
FIXME("(%p,%p,%p),stub!\n",lpRasDevinfo,lpcb,lpcDevices);
|
||||
if (*lpcb < sizeof(RASDEVINFOA)) {
|
||||
*lpcb = sizeof(RASDEVINFOA);
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
TOPSRCDIR = @top_srcdir@
|
||||
TOPOBJDIR = ../../..
|
||||
SRCDIR = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
TESTDLL = rasapi32.dll
|
||||
IMPORTS = kernel32
|
||||
|
||||
CTESTS = \
|
||||
rasapi.c
|
||||
|
||||
@MAKE_TEST_RULES@
|
||||
|
||||
@DEPENDENCIES@ # everything below this line is overwritten by make depend
|
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* Unit test suite for rasapi32 functions
|
||||
*
|
||||
* Copyright 2008 Austin English
|
||||
*
|
||||
* 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 <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <wine/test.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
#include "ras.h"
|
||||
|
||||
static HMODULE hmodule;
|
||||
static DWORD (WINAPI *pRasEnumDevicesA)(LPRASDEVINFOA, LPDWORD, LPDWORD);
|
||||
|
||||
#define RASAPI32_GET_PROC(func) \
|
||||
p ## func = (void*)GetProcAddress(hmodule, #func); \
|
||||
if(!p ## func) \
|
||||
trace("GetProcAddress(%s) failed\n", #func);
|
||||
|
||||
static void InitFunctionPtrs(void)
|
||||
{
|
||||
hmodule = LoadLibraryA("rasapi32.dll");
|
||||
|
||||
RASAPI32_GET_PROC(RasEnumDevicesA)
|
||||
}
|
||||
|
||||
static void test_rasenum(void)
|
||||
{
|
||||
DWORD result;
|
||||
DWORD cDevices = 0;
|
||||
DWORD cb = 0;
|
||||
RASDEVINFOA rasDevInfo;
|
||||
rasDevInfo.dwSize = sizeof(rasDevInfo);
|
||||
|
||||
if(!pRasEnumDevicesA) {
|
||||
win_skip("Skipping RasEnumDevicesA tests, function not present\n");
|
||||
return;
|
||||
}
|
||||
|
||||
result = pRasEnumDevicesA(NULL, &cb, &cDevices);
|
||||
trace("RasEnumDevicesA: buffersize %d\n", cb);
|
||||
ok(result == ERROR_BUFFER_TOO_SMALL,
|
||||
"Expected ERROR_BUFFER_TOO_SMALL, got %08d\n", result);
|
||||
|
||||
result = pRasEnumDevicesA(&rasDevInfo, NULL, &cDevices);
|
||||
ok(result == ERROR_INVALID_PARAMETER,
|
||||
"Expected ERROR_INVALID_PARAMETER, got %08d\n", result);
|
||||
}
|
||||
|
||||
START_TEST(rasapi)
|
||||
{
|
||||
InitFunctionPtrs();
|
||||
|
||||
test_rasenum();
|
||||
}
|
|
@ -81,6 +81,7 @@ TESTBINS = \
|
|||
qedit_test.exe \
|
||||
qmgr_test.exe \
|
||||
quartz_test.exe \
|
||||
rasapi32_test.exe \
|
||||
riched20_test.exe \
|
||||
riched32_test.exe \
|
||||
rpcrt4_test.exe \
|
||||
|
@ -220,6 +221,8 @@ qmgr_test.exe: $(DLLDIR)/qmgr/tests/qmgr_test.exe$(DLLEXT)
|
|||
cp $(DLLDIR)/qmgr/tests/qmgr_test.exe$(DLLEXT) $@ && $(STRIP) $@
|
||||
quartz_test.exe: $(DLLDIR)/quartz/tests/quartz_test.exe$(DLLEXT)
|
||||
cp $(DLLDIR)/quartz/tests/quartz_test.exe$(DLLEXT) $@ && $(STRIP) $@
|
||||
rasapi32_test.exe: $(DLLDIR)/rasapi32/tests/rasapi32_test.exe$(DLLEXT)
|
||||
cp $(DLLDIR)/rasapi32/tests/rasapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@
|
||||
riched20_test.exe: $(DLLDIR)/riched20/tests/riched20_test.exe$(DLLEXT)
|
||||
cp $(DLLDIR)/riched20/tests/riched20_test.exe$(DLLEXT) $@ && $(STRIP) $@
|
||||
riched32_test.exe: $(DLLDIR)/riched32/tests/riched32_test.exe$(DLLEXT)
|
||||
|
|
|
@ -142,6 +142,7 @@ psapi_test.exe TESTRES "psapi_test.exe"
|
|||
qedit_test.exe TESTRES "qedit_test.exe"
|
||||
qmgr_test.exe TESTRES "qmgr_test.exe"
|
||||
quartz_test.exe TESTRES "quartz_test.exe"
|
||||
rasapi32_test.exe TESTRES "rasapi32_test.exe"
|
||||
riched20_test.exe TESTRES "riched20_test.exe"
|
||||
riched32_test.exe TESTRES "riched32_test.exe"
|
||||
rpcrt4_test.exe TESTRES "rpcrt4_test.exe"
|
||||
|
|
Loading…
Reference in New Issue