comdlg32: Add initial test.

This commit is contained in:
Detlef Riekenberg 2006-07-03 22:55:53 +02:00 committed by Alexandre Julliard
parent 67fcd2f1ea
commit 955fe0da75
7 changed files with 108 additions and 1 deletions

3
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1568,6 +1568,7 @@ dlls/comcat/Makefile
dlls/comctl32/Makefile
dlls/comctl32/tests/Makefile
dlls/comdlg32/Makefile
dlls/comdlg32/tests/Makefile
dlls/compstui/Makefile
dlls/crtdll/Makefile
dlls/crypt32/Makefile

View File

@ -44,6 +44,8 @@ RC_BINARIES = \
pd32_nocollate.ico \
pd32_portrait.ico
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:

3
dlls/comdlg32/tests/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
Makefile
printdlg.ok
testlist.c

View File

@ -0,0 +1,13 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = comdlg32.dll
IMPORTS = comdlg32 kernel32
CTESTS = \
printdlg.c
@MAKE_TEST_RULES@
### Dependencies:

View File

@ -0,0 +1,84 @@
/*
* Unit test suite for comdlg32 API functions: printer dialogs
*
* Copyright 2006 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 "wingdi.h"
#include "winuser.h"
#include "cderr.h"
#include "commdlg.h"
#include "wine/test.h"
/* ##### */
static void test_PrintDlgA(void)
{
DWORD res;
LPPRINTDLGA pDlg;
pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2);
if (!pDlg) return;
#if 0
/* will crash with unpatched wine */
SetLastError(0xdeadbeef);
res = PrintDlgA(NULL);
ok( !res && (CommDlgExtendedError() == CDERR_INITIALIZATION),
"returned %ld with 0x%lx and 0x%lx (expected '0' and " \
"CDERR_INITIALIZATION)\n", res, GetLastError(), CommDlgExtendedError());
}
#endif
ZeroMemory(pDlg, sizeof(PRINTDLGA));
pDlg->lStructSize = sizeof(PRINTDLGA) - 1;
SetLastError(0xdeadbeef);
res = PrintDlgA(pDlg);
ok( !res && (CommDlgExtendedError() == CDERR_STRUCTSIZE),
"returned %ld with 0x%lx and 0x%lx (expected '0' and " \
"CDERR_STRUCTSIZE)\n", res, GetLastError(), CommDlgExtendedError());
ZeroMemory(pDlg, sizeof(PRINTDLGA));
pDlg->lStructSize = sizeof(PRINTDLGA);
pDlg->Flags = PD_RETURNDEFAULT;
SetLastError(0xdeadbeef);
res = PrintDlgA(pDlg);
ok(res, "returned %ld with 0x%lx and 0x%lx (expected '!= 0')\n", res, GetLastError(), CommDlgExtendedError());
HeapFree(GetProcessHeap(), 0, pDlg);
}
START_TEST(printdlg)
{
test_PrintDlgA();
}

View File

@ -23,6 +23,7 @@ TESTBINS = \
advpack_test.exe$(DLLEXT) \
cabinet_test.exe$(DLLEXT) \
comctl32_test.exe$(DLLEXT) \
comdlg32_test.exe$(DLLEXT) \
crypt32_test.exe$(DLLEXT) \
d3d8_test.exe$(DLLEXT) \
d3d9_test.exe$(DLLEXT) \
@ -109,6 +110,8 @@ cabinet_test.exe$(DLLEXT): $(DLLDIR)/cabinet/tests/cabinet_test.exe$(DLLEXT)
cp $(DLLDIR)/cabinet/tests/cabinet_test.exe$(DLLEXT) $@ && $(STRIP) $@
comctl32_test.exe$(DLLEXT): $(DLLDIR)/comctl32/tests/comctl32_test.exe$(DLLEXT)
cp $(DLLDIR)/comctl32/tests/comctl32_test.exe$(DLLEXT) $@ && $(STRIP) $@
comdlg32_test.exe$(DLLEXT): $(DLLDIR)/comdlg32/tests/comdlg32_test.exe$(DLLEXT)
cp $(DLLDIR)/comdlg32/tests/comdlg32_test.exe$(DLLEXT) $@ && $(STRIP) $@
crypt32_test.exe$(DLLEXT): $(DLLDIR)/crypt32/tests/crypt32_test.exe$(DLLEXT)
cp $(DLLDIR)/crypt32/tests/crypt32_test.exe$(DLLEXT) $@ && $(STRIP) $@
d3d8_test.exe$(DLLEXT): $(DLLDIR)/d3d8/tests/d3d8_test.exe$(DLLEXT)