atl/tests: Enable compilation with long types.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-02-23 09:11:23 +01:00 committed by Alexandre Julliard
parent 0c88eeee74
commit 4e1c7cd007
4 changed files with 35 additions and 35 deletions

View File

@ -1,6 +1,6 @@
TESTDLL = atl.dll TESTDLL = atl.dll
IMPORTS = uuid atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 IMPORTS = uuid atl oleaut32 ole32 rpcrt4 user32 gdi32 advapi32
EXTRADEFS = -DWINE_NO_LONG_TYPES -D_ATL_VER=_ATL_VER_30 EXTRADEFS = -D_ATL_VER=_ATL_VER_30
C_SRCS = \ C_SRCS = \
atl_ax.c \ atl_ax.c \

View File

@ -73,20 +73,20 @@ static void test_AtlAxAttachControl(void)
IUnknown *pObj, *pContainer; IUnknown *pObj, *pContainer;
hr = pAtlAxAttachControl(NULL, NULL, NULL); hr = pAtlAxAttachControl(NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
pContainer = (IUnknown *)0xdeadbeef; pContainer = (IUnknown *)0xdeadbeef;
hr = pAtlAxAttachControl(NULL, NULL, &pContainer); hr = pAtlAxAttachControl(NULL, NULL, &pContainer);
ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
ok(pContainer == (IUnknown *)0xdeadbeef, ok(pContainer == (IUnknown *)0xdeadbeef,
"Expected the output container pointer to be untouched, got %p\n", pContainer); "Expected the output container pointer to be untouched, got %p\n", pContainer);
hr = pAtlAxAttachControl(NULL, hwnd, NULL); hr = pAtlAxAttachControl(NULL, hwnd, NULL);
ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08x\n", hr); ok(hr == E_INVALIDARG, "Expected AtlAxAttachControl to return E_INVALIDARG, got 0x%08lx\n", hr);
hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, hr = CoCreateInstance(&CLSID_WebBrowser, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER,
&IID_IOleObject, (void **)&pObj); &IID_IOleObject, (void **)&pObj);
ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected CoCreateInstance to return S_OK, got 0x%08lx\n", hr);
if (FAILED(hr)) if (FAILED(hr))
{ {
@ -95,16 +95,16 @@ static void test_AtlAxAttachControl(void)
} }
hr = pAtlAxAttachControl(pObj, NULL, NULL); hr = pAtlAxAttachControl(pObj, NULL, NULL);
ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08lx\n", hr);
pContainer = NULL; pContainer = NULL;
hr = pAtlAxAttachControl(pObj, NULL, &pContainer); hr = pAtlAxAttachControl(pObj, NULL, &pContainer);
ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08lx\n", hr);
ok(pContainer != NULL, "got %p\n", pContainer); ok(pContainer != NULL, "got %p\n", pContainer);
IUnknown_Release(pContainer); IUnknown_Release(pContainer);
hr = pAtlAxAttachControl(pObj, hwnd, NULL); hr = pAtlAxAttachControl(pObj, hwnd, NULL);
ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08lx\n", hr);
IUnknown_Release(pObj); IUnknown_Release(pObj);

View File

@ -70,29 +70,29 @@ static void test_winmodule(void)
winmod.m_pCreateWndList = (void*)0xdeadbeef; winmod.m_pCreateWndList = (void*)0xdeadbeef;
winmod.m_csWindowCreate.LockCount = 0xdeadbeef; winmod.m_csWindowCreate.LockCount = 0xdeadbeef;
hres = AtlModuleInit(&winmod, NULL, NULL); hres = AtlModuleInit(&winmod, NULL, NULL);
ok(hres == S_OK, "AtlModuleInit failed: %08x\n", hres); ok(hres == S_OK, "AtlModuleInit failed: %08lx\n", hres);
ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList); ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %d\n", ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %ld\n",
winmod.m_csWindowCreate.LockCount); winmod.m_csWindowCreate.LockCount);
AtlModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001); AtlModuleAddCreateWndData(&winmod, create_data, (void*)0xdead0001);
ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n"); ok(winmod.m_pCreateWndList == create_data, "winmod.m_pCreateWndList != create_data\n");
ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis); ok(create_data[0].m_pThis == (void*)0xdead0001, "unexpected create_data[0].m_pThis %p\n", create_data[0].m_pThis);
ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %x\n", ok(create_data[0].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[0].m_dwThreadID %lx\n",
create_data[0].m_dwThreadID); create_data[0].m_dwThreadID);
ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext); ok(!create_data[0].m_pNext, "unexpected create_data[0].m_pNext %p\n", create_data[0].m_pNext);
AtlModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002); AtlModuleAddCreateWndData(&winmod, create_data+1, (void*)0xdead0002);
ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n"); ok(winmod.m_pCreateWndList == create_data+1, "winmod.m_pCreateWndList != create_data\n");
ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis); ok(create_data[1].m_pThis == (void*)0xdead0002, "unexpected create_data[1].m_pThis %p\n", create_data[1].m_pThis);
ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %x\n", ok(create_data[1].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[1].m_dwThreadID %lx\n",
create_data[1].m_dwThreadID); create_data[1].m_dwThreadID);
ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext); ok(create_data[1].m_pNext == create_data, "unexpected create_data[1].m_pNext %p\n", create_data[1].m_pNext);
AtlModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003); AtlModuleAddCreateWndData(&winmod, create_data+2, (void*)0xdead0003);
ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n"); ok(winmod.m_pCreateWndList == create_data+2, "winmod.m_pCreateWndList != create_data\n");
ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis); ok(create_data[2].m_pThis == (void*)0xdead0003, "unexpected create_data[2].m_pThis %p\n", create_data[2].m_pThis);
ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %x\n", ok(create_data[2].m_dwThreadID == GetCurrentThreadId(), "unexpected create_data[2].m_dwThreadID %lx\n",
create_data[2].m_dwThreadID); create_data[2].m_dwThreadID);
ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext); ok(create_data[2].m_pNext == create_data+1, "unexpected create_data[2].m_pNext %p\n", create_data[2].m_pNext);
@ -149,7 +149,7 @@ static void test_winclassinfo(void)
winmod.cbSize = sizeof(winmod); winmod.cbSize = sizeof(winmod);
winmod.m_pCreateWndList = (void*)0xdeadbeef; winmod.m_pCreateWndList = (void*)0xdeadbeef;
hres = AtlModuleInit(&winmod, NULL, NULL); hres = AtlModuleInit(&winmod, NULL, NULL);
ok(hres == S_OK, "AtlModuleInit failed: %08x\n", hres); ok(hres == S_OK, "AtlModuleInit failed: %08lx\n", hres);
ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList); ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
atom = AtlModuleRegisterWndClassInfoW(&winmod, &wci, &wndProc); atom = AtlModuleRegisterWndClassInfoW(&winmod, &wci, &wndProc);
@ -181,28 +181,28 @@ static void test_term(void)
test.cbSize = sizeof(_ATL_MODULEW); test.cbSize = sizeof(_ATL_MODULEW);
hres = AtlModuleInit(&test, NULL, NULL); hres = AtlModuleInit(&test, NULL, NULL);
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleInit failed (0x%lx).\n", hres);
hres = AtlModuleAddTermFunc(&test, term_callback, ex); hres = AtlModuleAddTermFunc(&test, term_callback, ex);
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%lx).\n", hres);
cb_val = 0xdeadbeef; cb_val = 0xdeadbeef;
hres = AtlModuleTerm(&test); hres = AtlModuleTerm(&test);
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleTerm failed (0x%lx).\n", hres);
ok (cb_val == ex, "wrong callback value (0x%lx).\n", cb_val); ok (cb_val == ex, "wrong callback value (0x%Ix).\n", cb_val);
test.cbSize = FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer); test.cbSize = FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer);
hres = AtlModuleInit(&test, NULL, NULL); hres = AtlModuleInit(&test, NULL, NULL);
ok (hres == S_OK, "AtlModuleInit failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleInit failed (0x%lx).\n", hres);
hres = AtlModuleAddTermFunc(&test, term_callback, 0x23); hres = AtlModuleAddTermFunc(&test, term_callback, 0x23);
ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleAddTermFunc failed (0x%lx).\n", hres);
cb_val = 0xdeadbeef; cb_val = 0xdeadbeef;
hres = AtlModuleTerm(&test); hres = AtlModuleTerm(&test);
ok (hres == S_OK, "AtlModuleTerm failed (0x%x).\n", hres); ok (hres == S_OK, "AtlModuleTerm failed (0x%lx).\n", hres);
ok (cb_val == 0xdeadbeef, "wrong callback value (0x%lx).\n", cb_val); ok (cb_val == 0xdeadbeef, "wrong callback value (0x%Ix).\n", cb_val);
} }
START_TEST(module) START_TEST(module)

View File

@ -68,7 +68,7 @@ static void test_registrar(void)
hr = CoCreateInstance(&CLSID_Registrar, NULL, CLSCTX_INPROC_SERVER, &IID_IRegistrar, (void**)&registrar); hr = CoCreateInstance(&CLSID_Registrar, NULL, CLSCTX_INPROC_SERVER, &IID_IRegistrar, (void**)&registrar);
if (FAILED(hr)) if (FAILED(hr))
{ {
win_skip("creating IRegistrar failed, hr = 0x%08X\n", hr); win_skip("creating IRegistrar failed, hr = 0x%08lX\n", hr);
return; return;
} }
@ -84,7 +84,7 @@ static void test_registrar(void)
MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, count); MultiByteToWideChar(CP_ACP, 0, textA, -1, textW, count);
hr = IRegistrar_StringRegister(registrar, textW); hr = IRegistrar_StringRegister(registrar, textW);
ok(hr == S_OK, "StringRegister failed: %08x\n", hr); ok(hr == S_OK, "StringRegister failed: %08lx\n", hr);
if (FAILED(hr)) if (FAILED(hr))
{ {
IRegistrar_Release(registrar); IRegistrar_Release(registrar);
@ -92,44 +92,44 @@ static void test_registrar(void)
} }
lret = RegOpenKeyA(HKEY_CURRENT_USER, "eebf73c4-50fd-478f-bbcf-db212221227a", &key); lret = RegOpenKeyA(HKEY_CURRENT_USER, "eebf73c4-50fd-478f-bbcf-db212221227a", &key);
ok(lret == ERROR_SUCCESS, "error %d opening registry key\n", lret); ok(lret == ERROR_SUCCESS, "error %ld opening registry key\n", lret);
size = sizeof(dword); size = sizeof(dword);
lret = RegQueryValueExA(key, "dword_unquoted_hex", NULL, NULL, (BYTE*)&dword, &size); lret = RegQueryValueExA(key, "dword_unquoted_hex", NULL, NULL, (BYTE*)&dword, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
ok(dword != 0xA, "unquoted hex is not supposed to be preserved\n"); ok(dword != 0xA, "unquoted hex is not supposed to be preserved\n");
size = sizeof(dword); size = sizeof(dword);
lret = RegQueryValueExA(key, "dword_quoted_hex", NULL, NULL, (BYTE*)&dword, &size); lret = RegQueryValueExA(key, "dword_quoted_hex", NULL, NULL, (BYTE*)&dword, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
ok(dword != 0xA, "quoted hex is not supposed to be preserved\n"); ok(dword != 0xA, "quoted hex is not supposed to be preserved\n");
size = sizeof(dword); size = sizeof(dword);
lret = RegQueryValueExA(key, "dword_unquoted_dec", NULL, NULL, (BYTE*)&dword, &size); lret = RegQueryValueExA(key, "dword_unquoted_dec", NULL, NULL, (BYTE*)&dword, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
ok(dword == 1, "unquoted dec is not supposed to be %d\n", dword); ok(dword == 1, "unquoted dec is not supposed to be %ld\n", dword);
size = sizeof(dword); size = sizeof(dword);
lret = RegQueryValueExA(key, "dword_quoted_dec", NULL, NULL, (BYTE*)&dword, &size); lret = RegQueryValueExA(key, "dword_quoted_dec", NULL, NULL, (BYTE*)&dword, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueExA failed, error %ld\n", lret);
ok(dword == 1, "quoted dec is not supposed to be %d\n", dword); ok(dword == 1, "quoted dec is not supposed to be %ld\n", dword);
size = 4; size = 4;
lret = RegQueryValueExA(key, "binary_quoted", NULL, NULL, bytes, &size); lret = RegQueryValueExA(key, "binary_quoted", NULL, NULL, bytes, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %ld\n", lret);
ok(bytes[0] == 0xde && bytes[1] == 0xad && bytes[2] == 0xbe && bytes[3] == 0xef, ok(bytes[0] == 0xde && bytes[1] == 0xad && bytes[2] == 0xbe && bytes[3] == 0xef,
"binary quoted value was not preserved (it's 0x%02X%02X%02X%02X)\n", "binary quoted value was not preserved (it's 0x%02X%02X%02X%02X)\n",
0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]); 0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]);
size = 4; size = 4;
lret = RegQueryValueExA(key, "binary_unquoted", NULL, NULL, bytes, &size); lret = RegQueryValueExA(key, "binary_unquoted", NULL, NULL, bytes, &size);
ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %d\n", lret); ok(lret == ERROR_SUCCESS, "RegQueryValueA, failed, error %ld\n", lret);
ok(bytes[0] == 0xde && bytes[1] == 0xad && bytes[2] == 0x01 && bytes[3] == 0x23, ok(bytes[0] == 0xde && bytes[1] == 0xad && bytes[2] == 0x01 && bytes[3] == 0x23,
"binary unquoted value was not preserved (it's 0x%02X%02X%02X%02X)\n", "binary unquoted value was not preserved (it's 0x%02X%02X%02X%02X)\n",
0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]); 0xff & bytes[0], 0xff & bytes[1], 0xff & bytes[2], 0xff & bytes[3]);
hr = IRegistrar_StringUnregister(registrar, textW); hr = IRegistrar_StringUnregister(registrar, textW);
ok(SUCCEEDED(hr), "IRegistrar_StringUnregister failed, hr = 0x%08X\n", hr); ok(SUCCEEDED(hr), "IRegistrar_StringUnregister failed, hr = 0x%08lX\n", hr);
RegCloseKey(key); RegCloseKey(key);
HeapFree(GetProcessHeap(), 0, textW); HeapFree(GetProcessHeap(), 0, textW);
@ -148,7 +148,7 @@ static void test_aggregation(void)
hres = CoCreateInstance(&CLSID_Registrar, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, hres = CoCreateInstance(&CLSID_Registrar, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IUnknown, (void**)&unk); &IID_IUnknown, (void**)&unk);
ok(hres == CLASS_E_NOAGGREGATION || broken(hres == E_INVALIDARG), ok(hres == CLASS_E_NOAGGREGATION || broken(hres == E_INVALIDARG),
"CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres); "CoCreateInstance failed: %08lx, expected CLASS_E_NOAGGREGATION\n", hres);
ok(!unk || unk == (IUnknown*)0xdeadbeef, "unk = %p\n", unk); ok(!unk || unk == (IUnknown*)0xdeadbeef, "unk = %p\n", unk);
} }