Module: wine Branch: master Commit: 81cbf29ef3f9a0164e861fdb908bb56e4edba22b URL: http://source.winehq.org/git/wine.git/?a=commit;h=81cbf29ef3f9a0164e861fdb90... Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Thu Jul 12 20:41:16 2012 -0300 user32/tests: Update DlgDirList tests. Based on original patch from Christian Lupien. --- dlls/user32/tests/listbox.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 1d6e8a3..4be7604 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1335,6 +1335,27 @@ static void test_listbox_dlgdir(void) ok (itemCount == itemCount_justDrives + itemCount_allDirs, "DlgDirList() incorrectly filled the listbox!\n"); + /* Test behavior when loading folders from root with and without wildcard */ + strcpy(pathBuffer, "C:\\"); + res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\ folders\n"); + todo_wine ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */, + "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer); + + strcpy(pathBuffer, "C:\\*"); + res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + ok(res || broken(!res) /* NT4/W2K */, "DlgDirList failed to list C:\\* folders\n"); + ok(!strcmp(pathBuffer, "*") || broken(!res) /* NT4/W2K */, + "DlgDirList set the invalid path spec '%s', expected '*'\n", pathBuffer); + + /* Try loading files from an invalid folder */ + SetLastError(0xdeadbeef); + strcpy(pathBuffer, "C:\\INVALID$$DIR"); + res = DlgDirList(hWnd, pathBuffer, ID_TEST_LISTBOX, 0, DDL_DIRECTORY | DDL_EXCLUSIVE); + todo_wine ok(!res, "DlgDirList should have failed with 0 but %d was returned\n", res); + todo_wine ok(GetLastError() == ERROR_NO_WILDCARD_CHARACTERS, + "GetLastError should return 0x589, got 0x%X\n",GetLastError()); + /* Now test DlgDirSelectEx() in normal operation */ /* Fill with everything - drives, directory and all plain files. */