Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/setupapi/tests/diskspace.c | 10 ++++------ dlls/setupapi/tests/setupcab.c | 5 ++--- 2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/setupapi/tests/diskspace.c b/dlls/setupapi/tests/diskspace.c index dab6705eee33..c92c15a821ae 100644 --- a/dlls/setupapi/tests/diskspace.c +++ b/dlls/setupapi/tests/diskspace.c @@ -375,8 +375,6 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
static void test_SetupQuerySpaceRequiredOnDriveW(void) { - static const WCHAR emptyW[] = {0}; - BOOL ret; HDSKSPC handle; LONGLONG space; @@ -403,7 +401,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void) GetLastError());
SetLastError(0xdeadbeef); - ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, NULL, NULL, 0); + ret = SetupQuerySpaceRequiredOnDriveW(NULL, L"", NULL, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected GetLastError() to return ERROR_INVALID_HANDLE, got %u\n", @@ -411,7 +409,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
SetLastError(0xdeadbeef); space = 0xdeadbeef; - ret = SetupQuerySpaceRequiredOnDriveW(NULL, emptyW, &space, NULL, 0); + ret = SetupQuerySpaceRequiredOnDriveW(NULL, L"", &space, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n"); ok(GetLastError() == ERROR_INVALID_HANDLE, @@ -441,7 +439,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void) GetLastError());
SetLastError(0xdeadbeef); - ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, NULL, NULL, 0); + ret = SetupQuerySpaceRequiredOnDriveW(handle, L"", NULL, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_DRIVE, "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", @@ -449,7 +447,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
SetLastError(0xdeadbeef); space = 0xdeadbeef; - ret = SetupQuerySpaceRequiredOnDriveW(handle, emptyW, &space, NULL, 0); + ret = SetupQuerySpaceRequiredOnDriveW(handle, L"", &space, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n"); ok(GetLastError() == ERROR_INVALID_DRIVE, diff --git a/dlls/setupapi/tests/setupcab.c b/dlls/setupapi/tests/setupcab.c index bb9add035dbb..183da9016594 100644 --- a/dlls/setupapi/tests/setupcab.c +++ b/dlls/setupapi/tests/setupcab.c @@ -143,7 +143,6 @@ static void test_invalid_parametersA(void) static void test_invalid_parametersW(void) { static const WCHAR nonexistentW[] = {'c',':','\','n','o','n','e','x','i','s','t','e','n','t','.','c','a','b',0}; - static const WCHAR emptyW[] = {0};
BOOL ret; WCHAR source[MAX_PATH], temp[MAX_PATH]; @@ -204,7 +203,7 @@ static void test_invalid_parametersW(void) GetLastError());
SetLastError(0xdeadbeef); - ret = SetupIterateCabinetW(emptyW, 0, NULL, NULL); + ret = SetupIterateCabinetW(L"", 0, NULL, NULL); ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret); ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY || GetLastError() == ERROR_FILE_NOT_FOUND, /* NT4/Win2k */ @@ -212,7 +211,7 @@ static void test_invalid_parametersW(void) GetLastError());
SetLastError(0xdeadbeef); - ret = SetupIterateCabinetW(emptyW, 0, dummy_callbackW, NULL); + ret = SetupIterateCabinetW(L"", 0, dummy_callbackW, NULL); ok(!ret, "Expected SetupIterateCabinetW to return 0, got %d\n", ret); ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY || GetLastError() == ERROR_FILE_NOT_FOUND, /* NT4/Win2k */
Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/setupapi/tests/install.c | 11 ++++++----- dlls/setupapi/tests/misc.c | 9 +++++---- dlls/setupapi/tests/query.c | 20 +++++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/dlls/setupapi/tests/install.c b/dlls/setupapi/tests/install.c index fd10fd913323..289328eed5a7 100644 --- a/dlls/setupapi/tests/install.c +++ b/dlls/setupapi/tests/install.c @@ -33,6 +33,7 @@ #include "shlobj.h" #include "fci.h"
+#include "wine/heap.h" #include "wine/test.h"
static const char inffile[] = "test.inf"; @@ -86,12 +87,12 @@ static BOOL file_exists(const char *path)
static void * CDECL mem_alloc(ULONG cb) { - return HeapAlloc(GetProcessHeap(), 0, cb); + return heap_alloc(cb); }
static void CDECL mem_free(void *memory) { - HeapFree(GetProcessHeap(), 0, memory); + heap_free(memory); }
static BOOL CDECL get_next_cabinet(PCCAB pccab, ULONG cbPrevCab, void *pv) @@ -189,17 +190,17 @@ static BOOL CDECL get_temp_file(char *pszTempName, int cbTempName, void *pv) { LPSTR tempname;
- tempname = HeapAlloc(GetProcessHeap(), 0, MAX_PATH); + tempname = heap_alloc(MAX_PATH); GetTempFileNameA(".", "xx", 0, tempname);
if (tempname && (strlen(tempname) < (unsigned)cbTempName)) { lstrcpyA(pszTempName, tempname); - HeapFree(GetProcessHeap(), 0, tempname); + heap_free(tempname); return TRUE; }
- HeapFree(GetProcessHeap(), 0, tempname); + heap_free(tempname);
return FALSE; } diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c index 3bb308ef4a74..9477d4a63126 100644 --- a/dlls/setupapi/tests/misc.c +++ b/dlls/setupapi/tests/misc.c @@ -31,6 +31,7 @@ #include "setupapi.h" #include "cfgmgr32.h"
+#include "wine/heap.h" #include "wine/test.h"
static CHAR CURR_DIR[MAX_PATH]; @@ -105,7 +106,7 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest) res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size); ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError());
- pspii = HeapAlloc(GetProcessHeap(), 0, size); + pspii = heap_alloc(size);
res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL); ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError()); @@ -121,7 +122,7 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest) ok(!spofi.OriginalCatalogName[0], "spofi.OriginalCatalogName should have been "" instead of "%s"\n", spofi.OriginalCatalogName); ok(!strcmp(original, spofi.OriginalInfName), "spofi.OriginalInfName of %s didn't match real original name %s\n", spofi.OriginalInfName, original);
- HeapFree(GetProcessHeap(), 0, pspii); + heap_free(pspii);
SetupCloseInfFile(hinf); } @@ -367,12 +368,12 @@ static BOOL compare_file_data(LPSTR file, const BYTE *data, DWORD size) LPBYTE buffer;
handle = CreateFileA(file, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - buffer = HeapAlloc(GetProcessHeap(), 0, size); + buffer = heap_free(size); if (buffer) { ReadFile(handle, buffer, size, &read, NULL); if (read == size && !memcmp(data, buffer, size)) ret = TRUE; - HeapFree(GetProcessHeap(), 0, buffer); + heap_free(buffer); } CloseHandle(handle); return ret; diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c index 6b6d1bd5c296..00b03b653809 100644 --- a/dlls/setupapi/tests/query.c +++ b/dlls/setupapi/tests/query.c @@ -21,6 +21,8 @@ #include <stdio.h> #include <windows.h> #include <setupapi.h> + +#include "wine/heap.h" #include "wine/test.h"
static CHAR CURR_DIR[MAX_PATH]; @@ -120,7 +122,7 @@ static BOOL check_info_filename(PSP_INF_INFORMATION info, LPSTR test) if (!SetupQueryInfFileInformationA(info, 0, NULL, 0, &size)) return FALSE;
- filename = HeapAlloc(GetProcessHeap(), 0, size); + filename = heap_alloc(size); if (!filename) return FALSE;
@@ -129,7 +131,7 @@ static BOOL check_info_filename(PSP_INF_INFORMATION info, LPSTR test) if (!lstrcmpiA(test, filename)) ret = TRUE;
- HeapFree(GetProcessHeap(), 0, filename); + heap_free(filename); return ret; }
@@ -142,7 +144,7 @@ static PSP_INF_INFORMATION alloc_inf_info(LPCSTR filename, DWORD search, PDWORD if (!ret) return NULL;
- info = HeapAlloc(GetProcessHeap(), 0, *size); + info = heap_alloc(*size); return info; }
@@ -234,7 +236,7 @@ static void test_SetupGetInfInformation(void) ret = SetupGetInfInformationA(inf_filename, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, size, NULL); ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
- info = HeapAlloc(GetProcessHeap(), 0, size); + info = heap_alloc(size);
/* try valid ReturnBuffer but too small size */ SetLastError(0xbeefcafe); @@ -248,7 +250,7 @@ static void test_SetupGetInfInformation(void) ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n"); ok(check_info_filename(info, inf_filename), "Expected returned filename to be equal\n");
- HeapFree(GetProcessHeap(), 0, info); + heap_free(info);
/* try the INFINFO_INF_SPEC_IS_HINF search flag */ hinf = SetupOpenInfFileA(inf_filename, NULL, INF_STYLE_WIN4, NULL); @@ -269,7 +271,7 @@ static void test_SetupGetInfInformation(void) } ok(ret, "can't create inf file %u\n", GetLastError());
- HeapFree(GetProcessHeap(), 0, info); + heap_free(info); info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
/* check if system32 is searched for inf */ @@ -284,7 +286,7 @@ static void test_SetupGetInfInformation(void) lstrcatA(inf_one, "test.inf"); create_inf_file(inf_one, inf_data1, sizeof(inf_data1) - 1);
- HeapFree(GetProcessHeap(), 0, info); + heap_free(info); info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
/* test the INFINFO_DEFAULT_SEARCH search flag */ @@ -292,7 +294,7 @@ static void test_SetupGetInfInformation(void) ok(ret == TRUE, "Expected SetupGetInfInformation to succeed: %d\n", GetLastError()); ok(check_info_filename(info, inf_one), "Expected returned filename to be equal\n");
- HeapFree(GetProcessHeap(), 0, info); + heap_free(info); info = alloc_inf_info("test.inf", INFINFO_REVERSE_DEFAULT_SEARCH, &size);
/* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */ @@ -301,7 +303,7 @@ static void test_SetupGetInfInformation(void) ok(check_info_filename(info, revfile), "Expected returned filename to be equal\n");
done: - HeapFree(GetProcessHeap(), 0, info); + heap_free(info); DeleteFileA(inf_filename); DeleteFileA(inf_one); DeleteFileA(inf_two);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58328
Your paranoid android.
=== build (build log) ===
../../../../wine/dlls/setupapi/tests/misc.c:371:12: error: void value not ignored as it ought to be Makefile:332: recipe for target 'misc.o' failed Makefile:7765: recipe for target 'dlls/setupapi/tests' failed Task: The exe32 Wine crossbuild failed
=== debian10 (build log) ===
../../../../wine/dlls/setupapi/tests/misc.c:371:12: error: void value not ignored as it ought to be Task: The win32 build failed
=== debian10 (build log) ===
../../../../wine/dlls/setupapi/tests/misc.c:371:12: error: void value not ignored as it ought to be Task: The wow64 build failed
Signed-off-by: Vijay Kiran Kamuju infyquest@gmail.com --- dlls/setupapi/tests/diskspace.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/setupapi/tests/diskspace.c b/dlls/setupapi/tests/diskspace.c index c92c15a821ae..289a2c396460 100644 --- a/dlls/setupapi/tests/diskspace.c +++ b/dlls/setupapi/tests/diskspace.c @@ -357,7 +357,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void) ret = SetupQuerySpaceRequiredOnDriveA(handle, "", NULL, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_DRIVE, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %u\n", GetLastError());
SetLastError(0xdeadbeef); @@ -366,7 +366,7 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void) ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveA to return FALSE, got %d\n", ret); ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n"); ok(GetLastError() == ERROR_INVALID_DRIVE, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %u\n", GetLastError());
ok(SetupDestroyDiskSpaceList(handle), @@ -442,7 +442,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void) ret = SetupQuerySpaceRequiredOnDriveW(handle, L"", NULL, NULL, 0); ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_DRIVE, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %u\n", GetLastError());
SetLastError(0xdeadbeef); @@ -451,7 +451,7 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void) ok(!ret, "Expected SetupQuerySpaceRequiredOnDriveW to return FALSE, got %d\n", ret); ok(space == 0xdeadbeef, "Expected output space parameter to be untouched\n"); ok(GetLastError() == ERROR_INVALID_DRIVE, - "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", + "Expected GetLastError() to return ERROR_INVALID_DRIVE, got %u\n", GetLastError());
ok(SetupDestroyDiskSpaceList(handle),
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=58329
Your paranoid android.
=== build (build log) ===
error: patch failed: dlls/setupapi/tests/diskspace.c:442 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/setupapi/tests/diskspace.c:442 Task: Patch failed to apply
=== debian10 (build log) ===
error: patch failed: dlls/setupapi/tests/diskspace.c:442 Task: Patch failed to apply