Commit 955fe0da authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

comdlg32: Add initial test.

parent 67fcd2f1
......@@ -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
......
......@@ -44,6 +44,8 @@ RC_BINARIES = \
pd32_nocollate.ico \
pd32_portrait.ico
SUBDIRS = tests
@MAKE_DLL_RULES@
### Dependencies:
Makefile
printdlg.ok
testlist.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../../..
SRCDIR = @srcdir@
VPATH = @srcdir@
TESTDLL = comdlg32.dll
IMPORTS = comdlg32 kernel32
CTESTS = \
printdlg.c
@MAKE_TEST_RULES@
### Dependencies:
/*
* 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();
}
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment