Austin Lund : comdlg32/tests: Fixed up handling of temporary file in printdlg tests.
Alexandre Julliard
julliard at winehq.org
Thu Oct 28 12:19:53 CDT 2010
Module: wine
Branch: master
Commit: 5f98620c052040f3d853c1a7f11a2ca9e6109d04
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f98620c052040f3d853c1a7f11a2ca9e6109d04
Author: Austin Lund <austin.lund at gmail.com>
Date: Wed Oct 27 10:32:35 2010 +1000
comdlg32/tests: Fixed up handling of temporary file in printdlg tests.
---
dlls/comdlg32/tests/printdlg.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c
index f021b01..cad080d 100644
--- a/dlls/comdlg32/tests/printdlg.c
+++ b/dlls/comdlg32/tests/printdlg.c
@@ -320,18 +320,14 @@ static void test_abort_proc(void)
if (!PrintDlgA(&pd))
{
skip("No default printer available.\n");
- ok(DeleteFileA(filename), "Failed to delete temporary file\n");
- return;
+ goto end;
}
GlobalFree(pd.hDevMode);
GlobalFree(pd.hDevNames);
ok(pd.hDC != NULL, "PrintDlg didn't return a DC.\n");
if (!(print_dc = pd.hDC))
- {
- ok(DeleteFileA(filename), "Failed to delete temporary file\n");
- return;
- }
+ goto end;
ok(SetAbortProc(print_dc, abort_proc) > 0, "SetAbortProc failed\n");
ok(!abort_proc_called, "AbortProc got called unexpectedly by SetAbortProc.\n");
@@ -371,7 +367,9 @@ static void test_abort_proc(void)
abort_proc_called = FALSE;
end:
- ok(DeleteFileA(filename), "Failed to delete temporary file\n");
+ SetLastError(0xdeadbeef);
+ if(!DeleteFileA(filename))
+ trace("Failed to delete temporary file (err = %x)\n", GetLastError());
}
/* ########################### */
More information about the wine-cvs
mailing list