On 1/8/2014 12:47, Zhenbo Li wrote:
try 3: Add 'static' in my code I forgot to call test_SHGetPathFromIDListA() in try2 Check GetLastError() as well try 2: Move code to string.c to avoid creating a new file. Avoid malloc() and free().
I'm working on Bug 33750, so I'll add test cases for SHGetPathFromIDListA gradually.
dlls/shell32/tests/string.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) +static void test_SHGetPathFromIDListA(void) +{
- BOOL ret;
- char pszPath[MAX_PATH];
- ret = SHGetPathFromIDListA(NULL, pszPath);
- ok(!ret, "SHGetPathFromIDListA should fail.\n");
- ok(GetLastError() == ERROR_PROC_NOT_FOUND,
"Bad GetLastError = %d\n", GetLastError());
+}
You need to set last error to something like 0xdeadbeef, your test suggest that this call doesn't set it. I guess you're trying to test return value only, but it could be interesting to test what happens to path buffer too.
P.S. please avoid psz* style prefixes in names.