Detlef Riekenberg : localui/tests: Add initial test.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Apr 9 07:36:15 CDT 2007
Module: wine
Branch: master
Commit: 62e92795e4d4beeb4d11284bdfbd1cf9daff9717
URL: http://source.winehq.org/git/wine.git/?a=commit;h=62e92795e4d4beeb4d11284bdfbd1cf9daff9717
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Fri Apr 6 22:33:17 2007 +0200
localui/tests: Add initial test.
---
.gitignore | 4 ++
Makefile.in | 2 +
configure | 3 +
configure.ac | 1 +
dlls/Makefile.in | 1 +
dlls/localui/tests/Makefile.in | 13 ++++++
dlls/localui/tests/localui.c | 91 ++++++++++++++++++++++++++++++++++++++++
programs/winetest/Makefile.in | 3 +
programs/winetest/winetest.rc | 1 +
9 files changed, 119 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index 6061205..c2709e8 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 877f215..7fa8ef0 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 9cf3cbb..e240093 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 f97fd3a..6d9e2cf 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 ea5c76c..a0dcea0 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 0000000..191a312
--- /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
+
+ at MAKE_TEST_RULES@
+
+ at 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 0000000..e3a1813
--- /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 <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;
+ }
+ }
+
+}
diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in
index 056d636..d9e6d22 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 2401ac1..0e62589 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"
More information about the wine-cvs
mailing list