add a test for IShellFolder_ParseDisplayName

Saulius Krasuckas saulius2 at ar.fi.lt
Tue Aug 2 06:27:30 CDT 2005


* On Tue, 2 Aug 2005, Saulius Krasuckas wrote:
> * On Tue, 19 Jul 2005, Saulius Krasuckas wrote:
> > 
> > Put failing test as todo_wine.
> 
> put todo_wine in the right place and test it.  

And correct comment.  Huh.


ChangeLog:
	Saulius Krasuckas <saulius.krasuckas_at_ieee.org>
	Added test for IShellFolder_ParseDisplayName.


Index: dlls/shell32/tests/shlfolder.c
===================================================================
RCS file: /home/wine/wine/dlls/shell32/tests/shlfolder.c,v
retrieving revision 1.24
diff -p -u -r1.24 shlfolder.c
--- dlls/shell32/tests/shlfolder.c      11 Jul 2005 10:59:41 -0000      1.24
+++ dlls/shell32/tests/shlfolder.c      2 Aug 2005 11:25:49 -0000
@@ -59,6 +59,41 @@ static void init_function_pointers(void)
     ok(hr == S_OK, "SHGetMalloc failed %08lx\n", hr);
 }
 
+static void test_ParseDisplayName(void)
+{
+    HRESULT hr;
+    IShellFolder *IDesktopFolder;
+    static const char *cNonExistDir1A = "c:\\nonexist_subdir";
+    static const char *cNonExistDir2A = "c:\\\\nonexist_subdir";
+    DWORD res;
+    WCHAR cTestDirW [MAX_PATH] = {0};
+    ITEMIDLIST *newPIDL;
+
+    hr = SHGetDesktopFolder(&IDesktopFolder);
+    if(hr != S_OK) return;
+
+    res = GetFileAttributesA(cNonExistDir1A);
+    if(res != INVALID_FILE_ATTRIBUTES) return;
+
+    MultiByteToWideChar(CP_ACP, 0, cNonExistDir1A, -1, cTestDirW, MAX_PATH);
+    hr = IShellFolder_ParseDisplayName(IDesktopFolder, 
+        NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
+    /* This call returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) only in Windows.
+     * Should we distinguish between cNonExistDir1A and cNonExistDir2A ?
+     * Putting test as todo. */
+    todo_wine
+    ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), 
+        "ParseDisplayName returned %08lx, expected 80070002\n", hr);
+
+    res = GetFileAttributesA(cNonExistDir2A);
+    if(res != INVALID_FILE_ATTRIBUTES) return;
+
+    MultiByteToWideChar(CP_ACP, 0, cNonExistDir2A, -1, cTestDirW, MAX_PATH);
+    hr = IShellFolder_ParseDisplayName(IDesktopFolder, 
+        NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
+    ok((hr == E_FAIL), "ParseDisplayName returned %08lx, expected E_FAIL\n", hr);
+}
+
 /* creates a file with the specified name for tests */
 static void CreateTestFile(const CHAR *name)
 {
@@ -624,6 +659,7 @@ START_TEST(shlfolder)
        CO_E_NOTINITIALIZED for malformed directory names on win2k. */
     OleInitialize(NULL);
 
+    test_ParseDisplayName();
     test_BindToObject();
     test_EnumObjects_and_CompareIDs();
     test_GetDisplayName();




More information about the wine-patches mailing list