SHELL32/tests: Re: add a test for IShellFolder_ParseDisplayName
Saulius Krasuckas
saulius2 at ar.fi.lt
Thu Jun 30 12:52:54 CDT 2005
Resyncing to CVS.
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.22
diff -p -u -r1.22 shlfolder.c
--- dlls/shell32/tests/shlfolder.c 30 Jun 2005 10:23:14 -0000 1.22
+++ dlls/shell32/tests/shlfolder.c 30 Jun 2005 17:47:13 -0000
@@ -59,6 +59,37 @@ 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);
+ 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)
{
@@ -621,6 +652,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