Module: wine Branch: master Commit: d8c90fa40b0bf08a9f0789dff34eb632a7482de6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d8c90fa40b0bf08a9f0789dff3...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jul 17 14:50:47 2012 +0200
user32/tests: Move DlgDirList tests to avoid changing the current directory for other tests.
---
dlls/user32/tests/listbox.c | 48 +++++++++++++++++++++--------------------- 1 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 4be7604..ef4a35b 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1335,28 +1335,6 @@ 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. */ strcpy(pathBuffer, "*"); @@ -1433,6 +1411,8 @@ static void test_listbox_dlgdir(void) } }
+ DeleteFileA( "wtest1.tmp.c" ); + /* Now test DlgDirSelectEx() in abnormal operation */ /* Fill list with bogus entries, that look somewhat valid */ SendMessage(g_listBox, LB_RESETCONTENT, 0, 0); @@ -1493,9 +1473,29 @@ static void test_listbox_dlgdir(void) ok (!strcmp(pathBuffer, tempBuffer), "Formatted file should be %s, got %s\n", tempBuffer, pathBuffer); } } - DestroyWindow(hWnd);
- DeleteFileA( "wtest1.tmp.c" ); + /* 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()); + + DestroyWindow(hWnd); }
START_TEST(listbox)