localui/tests: Add initial test.

This commit is contained in:
Detlef Riekenberg 2007-04-06 22:33:17 +02:00 committed by Alexandre Julliard
parent d24bc08783
commit 62e92795e4
9 changed files with 119 additions and 0 deletions

4
.gitignore vendored
View File

@ -282,6 +282,9 @@ dlls/localspl/localspl.res
dlls/localspl/tests/*.ok
dlls/localspl/tests/localspl_crosstest.exe
dlls/localspl/tests/testlist.c
dlls/localui/tests/*.ok
dlls/localui/tests/localui_crosstest.exe
dlls/localui/tests/testlist.c
dlls/lz32/liblz32.def
dlls/lz32/tests/*.ok
dlls/lz32/tests/lz32_crosstest.exe
@ -826,6 +829,7 @@ programs/winetest/iphlpapi_test.exe
programs/winetest/itss_test.exe
programs/winetest/kernel32_test.exe
programs/winetest/localspl_test.exe
programs/winetest/localui_test.exe
programs/winetest/lz32_test.exe
programs/winetest/mapi32_test.exe
programs/winetest/mlang_test.exe

View File

@ -255,6 +255,7 @@ ALL_MAKEFILES = \
dlls/localspl/Makefile \
dlls/localspl/tests/Makefile \
dlls/localui/Makefile \
dlls/localui/tests/Makefile \
dlls/lz32/Makefile \
dlls/lz32/tests/Makefile \
dlls/mapi32/Makefile \
@ -595,6 +596,7 @@ dlls/kernel32/tests/Makefile: dlls/kernel32/tests/Makefile.in dlls/Maketest.rule
dlls/localspl/Makefile: dlls/localspl/Makefile.in dlls/Makedll.rules
dlls/localspl/tests/Makefile: dlls/localspl/tests/Makefile.in dlls/Maketest.rules
dlls/localui/Makefile: dlls/localui/Makefile.in dlls/Makedll.rules
dlls/localui/tests/Makefile: dlls/localui/tests/Makefile.in dlls/Maketest.rules
dlls/lz32/Makefile: dlls/lz32/Makefile.in dlls/Makedll.rules
dlls/lz32/tests/Makefile: dlls/lz32/tests/Makefile.in dlls/Maketest.rules
dlls/mapi32/Makefile: dlls/mapi32/Makefile.in dlls/Makedll.rules

3
configure vendored
View File

@ -20398,6 +20398,8 @@ ac_config_files="$ac_config_files dlls/localspl/tests/Makefile"
ac_config_files="$ac_config_files dlls/localui/Makefile"
ac_config_files="$ac_config_files dlls/localui/tests/Makefile"
ac_config_files="$ac_config_files dlls/lz32/Makefile"
ac_config_files="$ac_config_files dlls/lz32/tests/Makefile"
@ -21517,6 +21519,7 @@ do
"dlls/localspl/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/localspl/Makefile" ;;
"dlls/localspl/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/localspl/tests/Makefile" ;;
"dlls/localui/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/localui/Makefile" ;;
"dlls/localui/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/localui/tests/Makefile" ;;
"dlls/lz32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/lz32/Makefile" ;;
"dlls/lz32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/lz32/tests/Makefile" ;;
"dlls/mapi32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/mapi32/Makefile" ;;

View File

@ -1589,6 +1589,7 @@ AC_CONFIG_FILES([dlls/kernel32/tests/Makefile])
AC_CONFIG_FILES([dlls/localspl/Makefile])
AC_CONFIG_FILES([dlls/localspl/tests/Makefile])
AC_CONFIG_FILES([dlls/localui/Makefile])
AC_CONFIG_FILES([dlls/localui/tests/Makefile])
AC_CONFIG_FILES([dlls/lz32/Makefile])
AC_CONFIG_FILES([dlls/lz32/tests/Makefile])
AC_CONFIG_FILES([dlls/mapi32/Makefile])

View File

@ -244,6 +244,7 @@ TESTSUBDIRS = \
itss/tests \
kernel32/tests \
localspl/tests \
localui/tests \
lz32/tests \
mapi32/tests \
mlang/tests \

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = localui.dll
IMPORTS = kernel32
CTESTS = \
localui.c
@MAKE_TEST_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

View File

@ -0,0 +1,91 @@
/*
* Unit test suite for the Local Printmonitor User Interface
*
* Copyright 2007 Detlef Riekenberg
*
* 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 "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wingdi.h"
#include "winreg.h"
#include "winspool.h"
#include "ddk/winsplp.h"
#include "wine/test.h"
/* ##### */
static HMODULE hdll;
static PMONITORUI (WINAPI *pInitializePrintMonitorUI)(VOID);
static PMONITORUI pui;
static BOOL (WINAPI *pAddPortUI)(PCWSTR, HWND, PCWSTR, PWSTR *);
static BOOL (WINAPI *pConfigurePortUI)(PCWSTR, HWND, PCWSTR);
static BOOL (WINAPI *pDeletePortUI)(PCWSTR, HWND, PCWSTR);
/* ########################### */
static LPCSTR load_functions(void)
{
LPCSTR ptr;
ptr = "localui.dll";
hdll = LoadLibraryA(ptr);
if (!hdll) return ptr;
ptr = "InitializePrintMonitorUI";
pInitializePrintMonitorUI = (VOID *) GetProcAddress(hdll, ptr);
if (!pInitializePrintMonitorUI) return ptr;
return NULL;
}
/* ########################### */
START_TEST(localui)
{
LPCSTR ptr;
DWORD numentries;
/* localui.dll does not exist before w2k */
ptr = load_functions();
if (ptr) {
skip("%s not found\n", ptr);
return;
}
pui = pInitializePrintMonitorUI();
if (pui) {
numentries = (pui->dwMonitorUISize - sizeof(DWORD)) / sizeof(VOID *);
ok( numentries == 3,
"dwMonitorUISize (%d) => %d Functions\n", pui->dwMonitorUISize, numentries);
if (numentries > 2) {
pAddPortUI = pui->pfnAddPortUI;
pConfigurePortUI = pui->pfnConfigurePortUI;
pDeletePortUI = pui->pfnDeletePortUI;
}
}
}

View File

@ -45,6 +45,7 @@ TESTBINS = \
itss_test.exe \
kernel32_test.exe \
localspl_test.exe \
localui_test.exe \
lz32_test.exe \
mapi32_test.exe \
mlang_test.exe \
@ -128,6 +129,8 @@ kernel32_test.exe: $(DLLDIR)/kernel32/tests/kernel32_test.exe$(DLLEXT)
cp $(DLLDIR)/kernel32/tests/kernel32_test.exe$(DLLEXT) $@ && $(STRIP) $@
localspl_test.exe: $(DLLDIR)/localspl/tests/localspl_test.exe$(DLLEXT)
cp $(DLLDIR)/localspl/tests/localspl_test.exe$(DLLEXT) $@ && $(STRIP) $@
localui_test.exe: $(DLLDIR)/localui/tests/localui_test.exe$(DLLEXT)
cp $(DLLDIR)/localui/tests/localui_test.exe$(DLLEXT) $@ && $(STRIP) $@
lz32_test.exe: $(DLLDIR)/lz32/tests/lz32_test.exe$(DLLEXT)
cp $(DLLDIR)/lz32/tests/lz32_test.exe$(DLLEXT) $@ && $(STRIP) $@
mapi32_test.exe: $(DLLDIR)/mapi32/tests/mapi32_test.exe$(DLLEXT)

View File

@ -168,6 +168,7 @@ iphlpapi_test.exe TESTRES "iphlpapi_test.exe"
itss_test.exe TESTRES "itss_test.exe"
kernel32_test.exe TESTRES "kernel32_test.exe"
localspl_test.exe TESTRES "localspl_test.exe"
localui_test.exe TESTRES "localui_test.exe"
lz32_test.exe TESTRES "lz32_test.exe"
mapi32_test.exe TESTRES "mapi32_test.exe"
mlang_test.exe TESTRES "mlang_test.exe"