From d71bc1503b0d8786a595db19956afb846e5e1b7d Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Mon, 14 Aug 2017 21:34:10 +0800 Subject: [PATCH] shell32/tests: Add more tests for SHGetKnownFolderIDList. Signed-off-by: Jactry Zeng Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- dlls/shell32/tests/shellpath.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 3292c544353..9fea876e8bd 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2781,9 +2781,33 @@ if (0) { /* crashes on native */ hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, 0, NULL, NULL); ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + pidl = (void*)0xdeadbeef; hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, 0, NULL, &pidl); - ok(hr == S_OK, "got 0x%08x\n", hr); - CoTaskMemFree(pidl); + ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr); + ok(ILIsEmpty(pidl), "pidl should be empty.\n"); + ok(pidl->mkid.cb == 0, "get wrong value: %d\n", pidl->mkid.cb); + ILFree(pidl); + + pidl = (void*)0xdeadbeef; + hr = pSHGetKnownFolderIDList(&FOLDERID_Desktop, KF_FLAG_NO_ALIAS, NULL, &pidl); + ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr); + todo_wine ok(!ILIsEmpty(pidl), "pidl should not be empty.\n"); + todo_wine ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb); + ILFree(pidl); + + pidl = (void*)0xdeadbeef; + hr = pSHGetKnownFolderIDList(&FOLDERID_Documents, 0, NULL, &pidl); + ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr); + ok(!ILIsEmpty(pidl), "pidl should not be empty.\n"); + ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb); + ILFree(pidl); + + pidl = (void*)0xdeadbeef; + hr = pSHGetKnownFolderIDList(&FOLDERID_Documents, KF_FLAG_NO_ALIAS, NULL, &pidl); + ok(hr == S_OK, "SHGetKnownFolderIDList failed: 0x%08x\n", hr); + ok(!ILIsEmpty(pidl), "pidl should not be empty.\n"); + ok(pidl->mkid.cb == 20, "get wrong value: %d\n", pidl->mkid.cb); + ILFree(pidl); } START_TEST(shellpath)