From c3b5406849e38c27fcd3c08b44430c04a7540bd9 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 2 Feb 2019 14:12:33 +0100 Subject: [PATCH] [SCRRUN_WINETEST] Sync with Wine Staging 4.0. CORE-15682 --- .../rostests/winetests/scrrun/dictionary.c | 15 +++++++----- .../rostests/winetests/scrrun/filesystem.c | 24 +++++++++---------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/modules/rostests/winetests/scrrun/dictionary.c b/modules/rostests/winetests/scrrun/dictionary.c index a6fecd15ba7..a058f40c0f7 100644 --- a/modules/rostests/winetests/scrrun/dictionary.c +++ b/modules/rostests/winetests/scrrun/dictionary.c @@ -18,6 +18,9 @@ */ #define COBJMACROS +#ifdef __REACTOS__ +#define CONST_VTABLE +#endif #include #include "windows.h" @@ -251,13 +254,13 @@ static ULONG WINAPI test_unk_Release(IUnknown *iface) return 1; } -static /* const */ IUnknownVtbl test_unk_vtbl = { +static const IUnknownVtbl test_unk_vtbl = { test_unk_QI, test_unk_AddRef, test_unk_Release }; -static /* const */ IUnknownVtbl test_unk_no_vtbl = { +static const IUnknownVtbl test_unk_no_vtbl = { test_unk_no_QI, test_unk_AddRef, test_unk_Release @@ -312,7 +315,7 @@ static HRESULT WINAPI test_disp_Invoke(IDispatch *iface, DISPID dispid, REFIID r return E_NOTIMPL; } -static /* const */ IDispatchVtbl test_disp_vtbl = { +static const IDispatchVtbl test_disp_vtbl = { test_disp_QI, test_disp_AddRef, test_disp_Release, @@ -368,7 +371,7 @@ static void test_hash_value(void) ok(V_VT(&hash) == VT_I4, "got %d\n", V_VT(&hash)); ok(V_I4(&hash) == 0, "got %d\n", V_I4(&hash)); - for (i = 0; i < sizeof(str_hash_tests)/sizeof(str_hash_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(str_hash_tests); i++) { expected = get_str_hash(str_hash_tests[i], BinaryCompare); hr = IDictionary_put_CompareMode(dict, BinaryCompare); @@ -461,7 +464,7 @@ static void test_hash_value(void) ok(V_VT(&hash) == VT_I4, "got %d\n", V_VT(&hash)); ok(V_I4(&hash) == ~0u, "got hash 0x%08x\n", V_I4(&hash)); - for (i = 0; i < sizeof(int_hash_tests)/sizeof(int_hash_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(int_hash_tests); i++) { SHORT i2; BYTE ui1; LONG i4; @@ -597,7 +600,7 @@ static void test_hash_value(void) ok(V_VT(&hash) == VT_I4, "got %d\n", V_VT(&hash)); ok(V_I4(&hash) == 0, "got hash 0x%08x\n", V_I4(&hash)); - for (i = 0; i < sizeof(float_hash_tests)/sizeof(float_hash_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(float_hash_tests); i++) { double dbl; FLOAT flt; DATE date; diff --git a/modules/rostests/winetests/scrrun/filesystem.c b/modules/rostests/winetests/scrrun/filesystem.c index d0c448c085a..29ee73f2433 100644 --- a/modules/rostests/winetests/scrrun/filesystem.c +++ b/modules/rostests/winetests/scrrun/filesystem.c @@ -375,7 +375,7 @@ static void test_GetFileVersion(void) BSTR path, version; HRESULT hr; - GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + GetSystemDirectoryW(pathW, ARRAY_SIZE(pathW)); lstrcpyW(filenameW, pathW); lstrcatW(filenameW, k32W); @@ -438,7 +438,7 @@ static void test_GetParentFolderName(void) hr = IFileSystem3_GetParentFolderName(fs3, NULL, NULL); ok(hr == E_POINTER, "GetParentFolderName returned %x, expected E_POINTER\n", hr); - for(i=0; i WCHAR conversion. */ buffW[0] = 0; - MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, sizeof(buffW)/sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, ARRAY_SIZE(buffW)); hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateFalse, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1569,7 +1569,7 @@ static void test_WriteLine(void) ret = ReadFile(file, buffA, sizeof(buffA), &r, NULL); ok(ret && r, "read %d, got %d, %d\n", r, ret, GetLastError()); - len = MultiByteToWideChar(CP_ACP, 0, buffA, r, buffW, sizeof(buffW)/sizeof(WCHAR)); + len = MultiByteToWideChar(CP_ACP, 0, buffA, r, buffW, ARRAY_SIZE(buffW)); buffW[len] = 0; lstrcpyW(buff2W, nameW); lstrcatW(buff2W, crlfW); @@ -1655,7 +1655,7 @@ static void test_ReadAll(void) hr = ITextStream_ReadAll(stream, &str); ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); buffW[0] = 0; - MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, sizeof(buffW)/sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, ARRAY_SIZE(buffW)); ok(str[0] == buffW[0] && str[1] == buffW[1], "got %s, %d\n", wine_dbgstr_w(str), SysStringLen(str)); SysFreeString(str); ITextStream_Release(stream); @@ -1801,7 +1801,7 @@ static void test_Read(void) ok(hr == S_OK, "got 0x%08x\n", hr); buffW[0] = 0; - MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, sizeof(buffW)/sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, utf16bom, -1, buffW, ARRAY_SIZE(buffW)); ok(!lstrcmpW(str, buffW), "got %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(buffW)); ok(SysStringLen(str) == 2, "got %d\n", SysStringLen(str)); @@ -2151,7 +2151,7 @@ static void test_GetExtensionName(void) HRESULT hr; int i; - for (i = 0; i < sizeof(extension_tests)/sizeof(extension_tests[0]); i++) { + for (i = 0; i < ARRAY_SIZE(extension_tests); i++) { path = SysAllocString(extension_tests[i].path); ext = NULL; @@ -2190,7 +2190,7 @@ static void test_GetSpecialFolder(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFolder_get_Path(folder, &path); ok(hr == S_OK, "got 0x%08x\n", hr); - GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + GetWindowsDirectoryW(pathW, ARRAY_SIZE(pathW)); ok(!lstrcmpiW(pathW, path), "got %s, expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(pathW)); SysFreeString(path); IFolder_Release(folder); @@ -2199,7 +2199,7 @@ static void test_GetSpecialFolder(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFolder_get_Path(folder, &path); ok(hr == S_OK, "got 0x%08x\n", hr); - GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + GetSystemDirectoryW(pathW, ARRAY_SIZE(pathW)); ok(!lstrcmpiW(pathW, path), "got %s, expected %s\n", wine_dbgstr_w(path), wine_dbgstr_w(pathW)); SysFreeString(path); IFolder_Release(folder); @@ -2208,7 +2208,7 @@ static void test_GetSpecialFolder(void) ok(hr == S_OK, "got 0x%08x\n", hr); hr = IFolder_get_Path(folder, &path); ok(hr == S_OK, "got 0x%08x\n", hr); - ret = GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + ret = GetTempPathW(ARRAY_SIZE(pathW), pathW); if (ret && pathW[ret-1] == '\\') pathW[ret-1] = 0;