Re: advpack: Improve DelNode and tests
"katahiromz ." <katayama.hirofumi.mz(a)gmail.com> writes:
@@ -327,6 +328,149 @@ done: return HRESULT_FROM_WIN32(dwLastError); }
+static HRESULT DELNODE_delete_file(LPWSTR fname) +{ + if (GetFileAttributesW(fname) != INVALID_FILE_ATTRIBUTES) + { + SetFileAttributesW(fname, FILE_ATTRIBUTE_NORMAL); + if (DeleteFileW(fname)) + { + return S_OK; + } + }
There shouldn't be any reason to retrieve attributes first.
+ /* generate a path with wildcard suitable for iterating */ + fname_len = lstrlenW(fname); + if (fname_len && fname[fname_len - 1] != L'\\') + { + fname[fname_len++] = L'\\';
Please don't use wide character constants.
C_SRCS = \ advpack.c \ + delnode.c \ files.c \ install.c
Please don't create a new file, the tests should go into files.c.
+static const NODEW s_nodesW[] = +{ + { L"dir1", TRUE }, /* 0 */ + { L"dir1\\dir2", TRUE }, /* 1 */ + { L"dir1\\dir2\\file1", FALSE }, /* 2 */
You can't use wide character strings in Wine.
+START_TEST(delnode) +{ + s_hAdvPack = LoadLibraryA("advpack.dll"); + if (s_hAdvPack == NULL) + { + skip("unable to load advpack.dll\n"); + return; + }
This shouldn't be necessary. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard