[PATCH 0/1] MR1486: shlwapi/tests: Use standard C functions for memory allocation in path.c.
From: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/shlwapi/tests/path.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/dlls/shlwapi/tests/path.c b/dlls/shlwapi/tests/path.c index 4614d3fea25..e349ba14272 100644 --- a/dlls/shlwapi/tests/path.c +++ b/dlls/shlwapi/tests/path.c @@ -190,27 +190,13 @@ static LPWSTR GetWideString(const char *src) if (!src) return NULL; - ret = HeapAlloc(GetProcessHeap(), 0, (2*INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); + ret = malloc((2 * INTERNET_MAX_URL_LENGTH) * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, src, -1, ret, INTERNET_MAX_URL_LENGTH); return ret; } -static void FreeWideString(LPWSTR wszString) -{ - HeapFree(GetProcessHeap(), 0, wszString); -} - -static LPSTR strdupA(LPCSTR p) -{ - LPSTR ret; - DWORD len = (strlen(p) + 1); - ret = HeapAlloc(GetProcessHeap(), 0, len); - memcpy(ret, p, len); - return ret; -} - /* ################ */ static void test_PathSearchAndQualify(void) @@ -326,8 +312,8 @@ static void test_PathCreateFromUrl(void) ok(len2 == len + 1, "got len = %ld expected %ld from url %s\n", len2, len + 1, TEST_PATHFROMURL[i].url); } - FreeWideString(urlW); - FreeWideString(pathW); + free(urlW); + free(pathW); } } @@ -340,7 +326,7 @@ static void test_PathCreateFromUrl(void) ret = pPathCreateFromUrlAlloc(fileW, &pathW, 0); ok(ret == S_OK, "got 0x%08lx expected S_OK\n", ret); ok(lstrcmpiW(pathW, fooW) == 0, "got %s expected %s\n", wine_dbgstr_w(pathW), wine_dbgstr_w(fooW)); - HeapFree(GetProcessHeap(), 0, pathW); + free(pathW); } } @@ -513,7 +499,7 @@ static void test_PathCombineW(void) return; } - wszString2 = HeapAlloc(GetProcessHeap(), 0, MAX_PATH * sizeof(WCHAR)); + wszString2 = malloc(MAX_PATH * sizeof(WCHAR)); /* NULL test */ wszString = pPathCombineW(NULL, NULL, NULL); @@ -529,7 +515,7 @@ static void test_PathCombineW(void) broken(wszString2[0] == 'a'), /* Win95 and some W2K */ "Destination string not empty\n"); - HeapFree(GetProcessHeap(), 0, wszString2); + free(wszString2); /* overflow test */ wstr2[0] = wstr2[1] = wstr2[2] = 'A'; @@ -1430,7 +1416,7 @@ static void test_PathUnquoteSpaces(void) int i; for (i = 0; i < ARRAY_SIZE(TEST_PATH_UNQUOTE_SPACES); i++) { - char *path = strdupA(TEST_PATH_UNQUOTE_SPACES[i].path); + char *path = strdup(TEST_PATH_UNQUOTE_SPACES[i].path); WCHAR *pathW = GetWideString(TEST_PATH_UNQUOTE_SPACES[i].path); WCHAR *resultW = GetWideString(TEST_PATH_UNQUOTE_SPACES[i].result); @@ -1442,9 +1428,9 @@ static void test_PathUnquoteSpaces(void) PathUnquoteSpacesW(pathW); ok(!lstrcmpW(pathW, resultW), "%s (W): strings differ\n", TEST_PATH_UNQUOTE_SPACES[i].path); - FreeWideString(pathW); - FreeWideString(resultW); - HeapFree(GetProcessHeap(), 0, path); + free(pathW); + free(resultW); + free(path); } } @@ -1680,7 +1666,7 @@ static void test_PathIsRelativeW(void) "PathIsRelativeW(\"%s\") expects %d, got %d.\n", test_path_is_relative[i].path, test_path_is_relative[i].expect, ret); - FreeWideString(path); + free(path); } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1486
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126605 Your paranoid android. === w7u_2qxl (32 bit report) === shlwapi: 070c:path: unhandled exception c0000005 at 77D92924 === w7u_adm (32 bit report) === shlwapi: 086c:path: unhandled exception c0000005 at 779528C7 === w7u_el (32 bit report) === shlwapi: 0a68:path: unhandled exception c0000005 at 773928C7 === w8 (32 bit report) === shlwapi: 0d40:path: unhandled exception c0000005 at 76F48F49 === w1064v1507 (32 bit report) === shlwapi: 0970:path: unhandled exception c0000005 at 777BC78E === w1064v1809 (32 bit report) === shlwapi: 1c58:path: unhandled exception c0000005 at 776171EA === w1064_tsign (32 bit report) === shlwapi: 183c:path: unhandled exception c0000005 at 778776DC === w10pro64 (32 bit report) === shlwapi: 1df4:path: unhandled exception c0000005 at 778C743C === w864 (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w1064v1507 (64 bit report) === shlwapi: 0fa8:path: unhandled exception c0000005 at 00007FF926D5AA09 === w1064v1809 (64 bit report) === shlwapi: 1cbc:path: unhandled exception c0000005 at 00007FFAC3912575 === w1064_2qxl (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w1064_adm (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w1064_tsign (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w10pro64 (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w10pro64_en_AE_u8 (64 bit report) === shlwapi: 2388:path: unhandled exception c0000005 at 00007FF99DFF6C3B === w10pro64_ar (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w10pro64_ja (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374) === w10pro64_zh_CN (64 bit report) === Report validation errors: shlwapi:path crashed (c0000374)
participants (3)
-
Alex Henrie -
Alex Henrie (@alexhenrie) -
Marvin