From 26869f8e6350690a239d468843bc4a74a162580d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 19 Aug 2016 09:24:50 +0000 Subject: [PATCH] [COMDLG32_WINETEST] Sync with Wine Staging 1.9.16. CORE-11866 svn path=/trunk/; revision=72339 --- rostests/winetests/comdlg32/filedlg.c | 56 ++++++++++++--------------- rostests/winetests/comdlg32/itemdlg.c | 15 +++++++ 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/rostests/winetests/comdlg32/filedlg.c b/rostests/winetests/comdlg32/filedlg.c index f4fd4646d8d..b3f26ada945 100644 --- a/rostests/winetests/comdlg32/filedlg.c +++ b/rostests/winetests/comdlg32/filedlg.c @@ -430,63 +430,56 @@ static UINT_PTR WINAPI resize_template_hook(HWND dlg, UINT msg, WPARAM wParam, L case cmb1: case edt1: ok( TESTRECTS( ctrlrcs[i], rc, 0, 10, 10, 0), - "control id %03x should have sized horizontally and moved vertically, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x should have sized horizontally and moved vertically, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* sized horizontal and vertical */ case lst2: ok( TESTRECTS( ctrlrcs[i], rc, 0, 0, 10, 10), - "control id %03x should have sized horizontally and vertically, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x should have sized horizontally and vertically, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* moved horizontal and vertical */ case IDCANCEL: case pshHelp: ok( TESTRECTS( ctrlrcs[i], rc, 10, 10, 0, 0), - "control id %03x should have moved horizontally and vertically, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x should have moved horizontally and vertically, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* moved vertically */ case chx1: case stc2: case stc3: ok( TESTRECTS( ctrlrcs[i], rc, 0, 10, 0, 0), - "control id %03x should have moved vertically, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x should have moved vertically, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* resized horizontal */ case cmb2: /* aka IDC_LOOKIN */ ok( TESTRECTS( ctrlrcs[i], rc, 0, 0, 10, 0)|| TESTRECTS( ctrlrcs[i], rc, 0, 0, 0, 0), /* Vista and higher */ - "control id %03x should have resized horizontally, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x should have resized horizontally, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* non moving non sizing controls */ case stc4: ok( TESTRECTS( rc, ctrlrcs[i], 0, 0, 0, 0), - "control id %03x was moved/resized, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x was moved/resized, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* todo_wine: non moving non sizing controls */ case lst1: todo_wine ok( TESTRECTS( rc, ctrlrcs[i], 0, 0, 0, 0), - "control id %03x was moved/resized, before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + "control id %03x was moved/resized, before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); break; /* don't test: id is not unique */ case IDOK: @@ -495,10 +488,9 @@ todo_wine case -1: break; default: - trace("untested control id %03x before %d,%d-%d,%d after %d,%d-%d,%d\n", - ctrlids[i], ctrlrcs[i].left, ctrlrcs[i].top, - ctrlrcs[i].right, ctrlrcs[i].bottom, - rc.left, rc.top, rc.right, rc.bottom); + trace("untested control id %03x before %s after %s\n", + ctrlids[i], wine_dbgstr_rect( &ctrlrcs[i] ), + wine_dbgstr_rect( &rc )); #undef TESTRECTS #undef MAXNRCTRLS } diff --git a/rostests/winetests/comdlg32/itemdlg.c b/rostests/winetests/comdlg32/itemdlg.c index f90d80d48f4..e338dcb00e3 100644 --- a/rostests/winetests/comdlg32/itemdlg.c +++ b/rostests/winetests/comdlg32/itemdlg.c @@ -802,6 +802,21 @@ static void test_basics(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFileOpenDialog_SetFileName(pfod, null); ok(hr == S_OK, "got 0x%08x\n", hr); + + filename = NULL; + hr = IFileOpenDialog_GetFileName(pfod, &filename); + ok(hr == S_OK, "Got 0x%08x\n", hr); + ok(!lstrcmpW(filename, null), "Strings do not match.\n"); + CoTaskMemFree(filename); + + hr = IFileOpenDialog_SetFileName(pfod, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + filename = (void*)0xdeadbeef; + hr = IFileOpenDialog_GetFileName(pfod, &filename); + ok(hr == E_FAIL, "Got 0x%08x\n", hr); + ok(filename == NULL, "got %p.\n", filename); + hr = IFileOpenDialog_SetFileName(pfod, txt); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFileOpenDialog_GetFileName(pfod, &filename);