comdlg32/tests: Skip remaining tests if StartDoc fails.

This commit is contained in:
Huw Davies 2009-02-18 12:42:50 +00:00 committed by Alexandre Julliard
parent f4e3e18b42
commit ecffb8038a

View File

@ -298,6 +298,7 @@ static void test_abort_proc(void)
DOCINFOA doc_info = {0};
PRINTDLGA pd = {0};
char filename[MAX_PATH];
int job_id;
if (!GetTempFileNameA(".", "prn", 0, filename))
{
@ -333,7 +334,14 @@ static void test_abort_proc(void)
doc_info.lpszDocName = "Some document";
doc_info.lpszOutput = filename;
ok(StartDocA(print_dc, &doc_info) > 0, "StartDocA failed\n");
job_id = StartDocA(print_dc, &doc_info);
ok(job_id > 0, "StartDocA failed ret %d gle %d\n", job_id, GetLastError());
if(job_id <= 0)
{
skip("StartDoc failed\n");
goto end;
}
ok(abort_proc_called, "AbortProc didn't get called by StartDoc.\n");
abort_proc_called = FALSE;
@ -357,6 +365,7 @@ static void test_abort_proc(void)
ok(!abort_proc_called, "AbortProc got called unexpectedly by DeleteDC.\n");
abort_proc_called = FALSE;
end:
ok(DeleteFileA(filename), "Failed to delete temporary file\n");
}