Module: wine Branch: master Commit: 65ab4b2cf077aa200a76cc8cb7b8f8dc39aeeaa7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=65ab4b2cf077aa200a76cc8cb7...
Author: Detlef Riekenberg wine.dev@web.de Date: Sun Mar 18 22:14:17 2012 +0100
comdlg32/tests: Remove outdated/unused code.
---
dlls/comdlg32/tests/printdlg.c | 47 +++++++-------------------------------- 1 files changed, 9 insertions(+), 38 deletions(-)
diff --git a/dlls/comdlg32/tests/printdlg.c b/dlls/comdlg32/tests/printdlg.c index c295df0..8597d5f 100644 --- a/dlls/comdlg32/tests/printdlg.c +++ b/dlls/comdlg32/tests/printdlg.c @@ -36,7 +36,6 @@ /* ########################### */
static HMODULE hcomdlg32; -static HRESULT (WINAPI * pPrintDlgExA)(LPPRINTDLGEXA); static HRESULT (WINAPI * pPrintDlgExW)(LPPRINTDLGEXW);
/* ########################### */ @@ -46,27 +45,6 @@ static const CHAR PrinterPortsA[] = "PrinterPorts";
/* ########################### */
-static LPCSTR load_functions(void) -{ - LPCSTR ptr; - - ptr = "comdlg32.dll"; - hcomdlg32 = GetModuleHandleA(ptr); - - ptr = "PrintDlgExA"; - pPrintDlgExA = (void *) GetProcAddress(hcomdlg32, ptr); - if (!pPrintDlgExA) return ptr; - - ptr = "PrintDlgExW"; - pPrintDlgExW = (void *) GetProcAddress(hcomdlg32, ptr); - if (!pPrintDlgExW) return ptr; - - return NULL; - -} - -/* ########################### */ - static void test_PageSetupDlgA(void) { LPPAGESETUPDLGA pDlg; @@ -237,15 +215,16 @@ static void test_PrintDlgExW(void) LPPRINTDLGEXW pDlg; HRESULT res;
+ /* PrintDlgEx not present before w2k */ + if (!pPrintDlgExW) { + skip("PrintDlgExW not available\n"); + return; + } + /* Set CommDlgExtendedError != 0 */ PrintDlg(NULL); SetLastError(0xdeadbeef); res = pPrintDlgExW(NULL); - if(res == E_NOTIMPL) - { - win_skip("PrintDlgExW returns not implemented\n"); - return; - } ok( (res == E_INVALIDARG), "got 0x%x with %u and %u (expected 'E_INVALIDARG')\n", res, GetLastError(), CommDlgExtendedError()); @@ -371,19 +350,11 @@ end:
START_TEST(printdlg) { - LPCSTR ptr; - - ptr = load_functions(); + hcomdlg32 = GetModuleHandleA("comdlg32.dll"); + pPrintDlgExW = (void *) GetProcAddress(hcomdlg32, "PrintDlgExW");
test_PageSetupDlgA(); test_PrintDlgA(); - test_abort_proc(); - - /* PrintDlgEx not present before w2k */ - if (ptr) { - win_skip("%s\n", ptr); - return; - } - test_PrintDlgExW(); + test_abort_proc(); }