diff --git a/.gitignore b/.gitignore index 6061205ce3d..c2709e82793 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/Makefile.in b/Makefile.in index 877f2153d0a..7fa8ef059be 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/configure b/configure index 9cf3cbb0000..e240093b828 100755 --- a/configure +++ b/configure @@ -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" ;; diff --git a/configure.ac b/configure.ac index f97fd3a6a9d..6d9e2cfaf86 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index ea5c76c6de8..a0dcea0715f 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -244,6 +244,7 @@ TESTSUBDIRS = \ itss/tests \ kernel32/tests \ localspl/tests \ + localui/tests \ lz32/tests \ mapi32/tests \ mlang/tests \ diff --git a/dlls/localui/tests/Makefile.in b/dlls/localui/tests/Makefile.in new file mode 100644 index 00000000000..191a3129d4a --- /dev/null +++ b/dlls/localui/tests/Makefile.in @@ -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 diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c new file mode 100644 index 00000000000..e3a181314a1 --- /dev/null +++ b/dlls/localui/tests/localui.c @@ -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 + +#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; + } + } + +} diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index 056d636a975..d9e6d22237d 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -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) diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index 2401ac1598a..0e62589c342 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -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"