Commit b1e007e3 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

shell32/tests: Fix a test failure on Vista and higher.

parent fb37e89a
...@@ -1558,7 +1558,7 @@ static void testSHGetFolderPathAndSubDirA(void) ...@@ -1558,7 +1558,7 @@ static void testSHGetFolderPathAndSubDirA(void)
static char toolongpath[MAX_PATH+1]; static char toolongpath[MAX_PATH+1];
if(!pSHGetFolderPathA) { if(!pSHGetFolderPathA) {
skip("SHGetFolderPathA not present!\n"); win_skip("SHGetFolderPathA not present!\n");
return; return;
} }
if(FAILED(pSHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata))) if(FAILED(pSHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, appdata)))
...@@ -1580,16 +1580,13 @@ static void testSHGetFolderPathAndSubDirA(void) ...@@ -1580,16 +1580,13 @@ static void testSHGetFolderPathAndSubDirA(void)
skip("RemoveDirectoryA(%s) failed with error %u\n", testpath, GetLastError()); skip("RemoveDirectoryA(%s) failed with error %u\n", testpath, GetLastError());
return; return;
} }
for(i=0; i< MAX_PATH; i++)
toolongpath[i] = '0' + i % 10;
toolongpath[MAX_PATH] = '\0';
/* test invalid second parameter */ /* test invalid second parameter */
ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath); ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | 0xff, NULL, SHGFP_TYPE_CURRENT, wine, testpath);
ok(E_INVALIDARG == ret, "expected E_INVALIDARG, got %x\n", ret); ok(E_INVALIDARG == ret, "expected E_INVALIDARG, got %x\n", ret);
/* test invalid forth parameter */ /* test fourth parameter */
ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, wine, testpath); ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, 2, winetemp, testpath);
switch(ret) { switch(ret) {
case S_OK: /* winvista */ case S_OK: /* winvista */
ok(!strncmp(appdata, testpath, strlen(appdata)), ok(!strncmp(appdata, testpath, strlen(appdata)),
...@@ -1619,6 +1616,9 @@ static void testSHGetFolderPathAndSubDirA(void) ...@@ -1619,6 +1616,9 @@ static void testSHGetFolderPathAndSubDirA(void)
ok(S_OK == ret, "expected S_OK, got %x\n", ret); ok(S_OK == ret, "expected S_OK, got %x\n", ret);
ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath); ok(!lstrcmpA(appdata, testpath), "expected %s, got %s\n", appdata, testpath);
for(i=0; i< MAX_PATH; i++)
toolongpath[i] = '0' + i % 10;
toolongpath[MAX_PATH] = '\0';
ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath); ret = pSHGetFolderPathAndSubDirA(NULL, CSIDL_FLAG_DONT_VERIFY | CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, toolongpath, testpath);
ok(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) == ret, ok(HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE) == ret,
"expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), ret); "expected %x, got %x\n", HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE), ret);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment