Commit 816395e8 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

mscoree/tests: Enable compilation with long types.

parent b83e327a
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = mscoree.dll
IMPORTS = ole32 shlwapi uuid shell32 advapi32
......
......@@ -92,7 +92,7 @@ static BOOL compile_cs_to_dll(char *source_path, char *dest_path)
si.cb = sizeof(si);
ret = CreateProcessA(path_csc, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
ok(ret, "Could not create process: %u\n", GetLastError());
ok(ret, "Could not create process: %lu\n", GetLastError());
WaitForSingleObject(pi.hProcess, 5000);
CloseHandle(pi.hThread);
......@@ -117,13 +117,13 @@ static void run_test(BOOL expect_success)
hr = CoCreateInstance(&CLSID_Test, NULL, CLSCTX_INPROC_SERVER, &IID_ITest, (void**)&test);
todo_wine_if(!expect_success)
ok(hr == result_expected, "Expected %x, got %x\n", result_expected, hr);
ok(hr == result_expected, "Expected %lx, got %lx\n", result_expected, hr);
if (hr == S_OK)
{
int i = 0;
hr = ITest_Func(test, &i);
ok(hr == S_OK, "Got %x\n", hr);
ok(hr == S_OK, "Got %lx\n", hr);
ok(i == 42, "Expected 42, got %d\n", i);
ITest_Release(test);
}
......@@ -131,20 +131,20 @@ static void run_test(BOOL expect_success)
getClassObject = (_DllGetClassObject)GetProcAddress(hmscoree, "DllGetClassObject");
hr = getClassObject(&CLSID_Test, &IID_IClassFactory, (void **)&classFactory);
todo_wine_if(!expect_success)
ok(hr == result_expected, "Expected %x, got %x\n", result_expected, hr);
ok(hr == result_expected, "Expected %lx, got %lx\n", result_expected, hr);
if (hr == S_OK)
{
ITest *test2 = NULL;
hr = IClassFactory_CreateInstance(classFactory, NULL, &IID_ITest, (void **)&test2);
todo_wine_if(!expect_success)
ok(hr == S_OK, "Got %x\n", hr);
ok(hr == S_OK, "Got %lx\n", hr);
if (hr == S_OK)
{
int i = 0;
hr = ITest_Func(test2, &i);
ok(hr == S_OK, "Got %x\n", hr);
ok(hr == S_OK, "Got %lx\n", hr);
ok(i == 42, "Expected 42, got %d\n", i);
ITest_Release(test2);
}
......@@ -174,28 +174,28 @@ static void run_registry_test(run_type run)
RegCloseKey(hkey);
return;
}
ok(ret == ERROR_SUCCESS, "RegCreateKeyA returned %x\n", ret);
ok(ret == ERROR_SUCCESS, "RegCreateKeyA returned %lx\n", ret);
ret = RegSetKeyValueA(hkey, "InprocServer32", NULL, REG_SZ, "mscoree.dll", 11);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %x\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %lx\n", ret);
ret = RegSetKeyValueA(hkey, "InprocServer32", "Assembly", REG_SZ, "comtest, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", 74);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %x\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %lx\n", ret);
ret = RegSetKeyValueA(hkey, "InprocServer32", "Class", REG_SZ, "DLL.Test", 8);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %x\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %lx\n", ret);
ret = RegSetKeyValueA(hkey, "InprocServer32", "CodeBase", REG_SZ, "file:///U:/invalid/path/to/comtest.dll", 41);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %x\n", ret);
ok(ret == ERROR_SUCCESS, "RegSetKeyValueA returned %lx\n", ret);
hr = CoCreateInstance(&CLSID_Test, NULL, CLSCTX_INPROC_SERVER, &IID_ITest, (void**)&test);
todo_wine_if(result_expected != S_OK)
ok(hr == result_expected, "Expected %x, got %x\n", result_expected, hr);
ok(hr == result_expected, "Expected %lx, got %lx\n", result_expected, hr);
if (hr == S_OK)
{
hr = ITest_Func(test, &i);
ok(hr == S_OK, "Got %x\n", hr);
ok(hr == S_OK, "Got %lx\n", hr);
ok(i == 42, "Expected 42, got %d\n", i);
hr = ITest_QueryInterface(test, &IID_ITest2, (void**)&unk);
ok(hr == S_OK, "ITest_QueryInterface returned %x\n", hr);
ok(hr == S_OK, "ITest_QueryInterface returned %lx\n", hr);
if (hr == S_OK) IUnknown_Release(unk);
ITest_Release(test);
}
......@@ -290,7 +290,7 @@ static void prepare_and_run_test(const char *dll_source, run_type run)
context.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
handle_context = CreateActCtxA(&context);
ok(handle_context != NULL && handle_context != INVALID_HANDLE_VALUE, "run: %d, CreateActCtxA failed: %d\n", run, GetLastError());
ok(handle_context != NULL && handle_context != INVALID_HANDLE_VALUE, "run: %d, CreateActCtxA failed: %ld\n", run, GetLastError());
if (handle_context == NULL || handle_context == INVALID_HANDLE_VALUE)
{
......@@ -299,7 +299,7 @@ static void prepare_and_run_test(const char *dll_source, run_type run)
}
success = ActivateActCtx(handle_context, &cookie);
ok(success, "run: %d, ActivateActCtx failed: %d\n", run, GetLastError());
ok(success, "run: %d, ActivateActCtx failed: %ld\n", run, GetLastError());
if (run == run_type_current_working_directory)
SetCurrentDirectoryA(path_tmp);
......@@ -311,23 +311,23 @@ cleanup:
if (handle_context != NULL && handle_context != INVALID_HANDLE_VALUE)
{
success = DeactivateActCtx(0, cookie);
ok(success, "run: %d, DeactivateActCtx failed: %d\n", run, GetLastError());
ok(success, "run: %d, DeactivateActCtx failed: %ld\n", run, GetLastError());
ReleaseActCtx(handle_context);
}
if (*path_manifest_exe)
{
success = DeleteFileA(path_manifest_exe);
ok(success, "run: %d, DeleteFileA failed: %d\n", run, GetLastError());
ok(success, "run: %d, DeleteFileA failed: %ld\n", run, GetLastError());
}
if(*path_manifest_dll)
{
success = DeleteFileA(path_manifest_dll);
ok(success, "run: %d, DeleteFileA failed: %d\n", run, GetLastError());
ok(success, "run: %d, DeleteFileA failed: %ld\n", run, GetLastError());
}
if(*path_dll_source)
{
success = DeleteFileA(path_dll_source);
ok(success, "run: %d, DeleteFileA failed: %d\n", run, GetLastError());
ok(success, "run: %d, DeleteFileA failed: %ld\n", run, GetLastError());
}
RemoveDirectoryA(path_tmp_manifest);
/* dll cleanup is handled by the parent, because it might still be used by the child */
......@@ -350,7 +350,7 @@ static void cleanup_test(run_type run)
Sleep(500);
success = DeleteFileA(path_dll);
}
ok(success, "DeleteFileA failed: %d\n", GetLastError());
ok(success, "DeleteFileA failed: %ld\n", GetLastError());
}
static void run_child_process(const char *dll_source, run_type run)
......@@ -372,7 +372,7 @@ static void run_child_process(const char *dll_source, run_type run)
si.cb = sizeof(si);
ret = CreateProcessA(exe, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
ok(ret, "Could not create process: %u\n", GetLastError());
ok(ret, "Could not create process: %lu\n", GetLastError());
wait_child_process(pi.hProcess);
......
......@@ -410,17 +410,17 @@ static void _check_process_enum(unsigned line, ICorDebug *pCorDebug, ULONG nExpe
ICorDebugProcessEnum *pProcessEnum = NULL;
hr = ICorDebug_EnumerateProcesses(pCorDebug, NULL);
ok_(__FILE__,line) (hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
ok_(__FILE__,line) (hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr);
hr = ICorDebug_EnumerateProcesses(pCorDebug, &pProcessEnum);
ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08lx\n", hr);
if(hr == S_OK)
{
ULONG cnt;
hr = ICorDebugProcessEnum_GetCount(pProcessEnum, &cnt);
ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08x\n", hr);
ok_(__FILE__,line) (cnt == nExpected, "expected %d got %d\n", nExpected, cnt);
ok_(__FILE__,line) (hr == S_OK, "expected S_OK got %08lx\n", hr);
ok_(__FILE__,line) (cnt == nExpected, "expected %ld got %ld\n", nExpected, cnt);
ICorDebugProcessEnum_Release(pProcessEnum);
}
......@@ -433,36 +433,36 @@ static void test_createDebugger(void)
ICorDebug *pCorDebug;
hr = pCreateDebuggingInterfaceFromVersion(0, v2_0, &pUnk);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08lx\n", hr);
hr = pCreateDebuggingInterfaceFromVersion(1, v2_0, &pUnk);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08lx\n", hr);
hr = pCreateDebuggingInterfaceFromVersion(2, v2_0, &pUnk);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08lx\n", hr);
hr = pCreateDebuggingInterfaceFromVersion(4, v2_0, &pUnk);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08lx\n", hr);
hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, NULL);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateDebuggingInterfaceFromVersion returned %08lx\n", hr);
hr = pCreateDebuggingInterfaceFromVersion(3, v2_0, &pUnk);
if(hr == S_OK)
{
hr = IUnknown_QueryInterface(pUnk, &IID_ICorDebug, (void**)&pCorDebug);
ok(hr == S_OK, "expected S_OK got %08x\n", hr);
ok(hr == S_OK, "expected S_OK got %08lx\n", hr);
if(hr == S_OK)
{
hr = ICorDebug_Initialize(pCorDebug);
ok(hr == S_OK, "expected S_OK got %08x\n", hr);
ok(hr == S_OK, "expected S_OK got %08lx\n", hr);
if(hr == S_OK)
{
hr = ICorDebug_SetManagedHandler(pCorDebug, NULL);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08x\n", hr);
ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr);
hr = ICorDebug_SetManagedHandler(pCorDebug, &ManagedCallback);
ok(hr == S_OK, "expected S_OK got %08x\n", hr);
ok(hr == S_OK, "expected S_OK got %08lx\n", hr);
/* We should have no processes */
check_process_enum(pCorDebug, 0);
......
......@@ -84,16 +84,16 @@ static void test_getruntime(WCHAR *version)
WCHAR buf[MAX_PATH];
hr = ICLRMetaHost_GetRuntime(metahost, NULL, &IID_ICLRRuntimeInfo, (void**)&info);
ok(hr == E_POINTER, "GetVersion failed, hr=%x\n", hr);
ok(hr == E_POINTER, "GetVersion failed, hr=%lx\n", hr);
hr = ICLRMetaHost_GetRuntime(metahost, version, &IID_ICLRRuntimeInfo, (void**)&info);
ok(hr == S_OK, "GetVersion failed, hr=%x\n", hr);
ok(hr == S_OK, "GetVersion failed, hr=%lx\n", hr);
if (hr != S_OK) return;
count = MAX_PATH;
hr = ICLRRuntimeInfo_GetVersionString(info, buf, &count);
ok(hr == S_OK, "GetVersionString returned %x\n", hr);
ok(count == lstrlenW(buf)+1, "GetVersionString returned count %u but string of length %u\n", count, lstrlenW(buf)+1);
ok(hr == S_OK, "GetVersionString returned %lx\n", hr);
ok(count == lstrlenW(buf)+1, "GetVersionString returned count %lu but string of length %u\n", count, lstrlenW(buf)+1);
ok(lstrcmpW(buf, version) == 0, "got unexpected version %s\n", wine_dbgstr_w(buf));
ICLRRuntimeInfo_Release(info);
......@@ -102,7 +102,7 @@ static void test_getruntime(WCHAR *version)
dot = wcsrchr(version, '.');
lstrcpyW(dot, dotzero);
hr = ICLRMetaHost_GetRuntime(metahost, version, &IID_ICLRRuntimeInfo, (void**)&info);
ok(hr == CLR_E_SHIM_RUNTIME, "GetVersion failed, hr=%x\n", hr);
ok(hr == CLR_E_SHIM_RUNTIME, "GetVersion failed, hr=%lx\n", hr);
}
static void test_enumruntimes(void)
......@@ -115,28 +115,28 @@ static void test_enumruntimes(void)
WCHAR buf[MAX_PATH];
hr = ICLRMetaHost_EnumerateInstalledRuntimes(metahost, &runtime_enum);
ok(hr == S_OK, "EnumerateInstalledRuntimes returned %x\n", hr);
ok(hr == S_OK, "EnumerateInstalledRuntimes returned %lx\n", hr);
if (FAILED(hr)) return;
while ((hr = IEnumUnknown_Next(runtime_enum, 1, &unk, &count)) == S_OK)
{
hr = IUnknown_QueryInterface(unk, &IID_ICLRRuntimeInfo, (void**)&runtime_info);
ok(hr == S_OK, "QueryInterface returned %x\n", hr);
ok(hr == S_OK, "QueryInterface returned %lx\n", hr);
count = 1;
hr = ICLRRuntimeInfo_GetVersionString(runtime_info, buf, &count);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetVersionString returned %x\n", hr);
ok(count > 1, "GetVersionString returned count %u\n", count);
ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetVersionString returned %lx\n", hr);
ok(count > 1, "GetVersionString returned count %lu\n", count);
count = 0xdeadbeef;
hr = ICLRRuntimeInfo_GetVersionString(runtime_info, NULL, &count);
ok(hr == S_OK, "GetVersionString returned %x\n", hr);
ok(count > 1 && count != 0xdeadbeef, "GetVersionString returned count %u\n", count);
ok(hr == S_OK, "GetVersionString returned %lx\n", hr);
ok(count > 1 && count != 0xdeadbeef, "GetVersionString returned count %lu\n", count);
count = MAX_PATH;
hr = ICLRRuntimeInfo_GetVersionString(runtime_info, buf, &count);
ok(hr == S_OK, "GetVersionString returned %x\n", hr);
ok(count > 1, "GetVersionString returned count %u\n", count);
ok(hr == S_OK, "GetVersionString returned %lx\n", hr);
ok(count > 1, "GetVersionString returned count %lu\n", count);
trace("runtime found: %s\n", wine_dbgstr_w(buf));
......@@ -146,7 +146,7 @@ static void test_enumruntimes(void)
test_getruntime(buf);
}
ok(hr == S_FALSE, "IEnumUnknown_Next returned %x\n", hr);
ok(hr == S_FALSE, "IEnumUnknown_Next returned %lx\n", hr);
IEnumUnknown_Release(runtime_enum);
}
......@@ -169,19 +169,19 @@ static void WINAPI notification_callback(ICLRRuntimeInfo *pRuntimeInfo, Callback
if (expect_runtime_tid != 0)
{
ok(GetCurrentThreadId() == expect_runtime_tid,
"expected call on thread %04x, got thread %04x\n", expect_runtime_tid, GetCurrentThreadId());
"expected call on thread %04lx, got thread %04lx\n", expect_runtime_tid, GetCurrentThreadId());
expect_runtime_tid = 0;
}
hr = ICLRRuntimeInfo_GetVersionString(pRuntimeInfo, buf, &buf_size);
ok(hr == S_OK, "GetVersion returned %x\n", hr);
ok(hr == S_OK, "GetVersion returned %lx\n", hr);
ok(lstrcmpW(buf, v4_0) == 0, "GetVersion returned %s\n", wine_dbgstr_w(buf));
hr = pfnCallbackThreadSet();
ok(hr == S_OK, "pfnCallbackThreadSet returned %x\n", hr);
ok(hr == S_OK, "pfnCallbackThreadSet returned %lx\n", hr);
hr = pfnCallbackThreadUnset();
ok(hr == S_OK, "pfnCallbackThreadUnset returned %x\n", hr);
ok(hr == S_OK, "pfnCallbackThreadUnset returned %lx\n", hr);
}
static void test_notification(void)
......@@ -189,13 +189,13 @@ static void test_notification(void)
HRESULT hr;
hr = ICLRMetaHost_RequestRuntimeLoadedNotification(metahost, NULL);
ok(hr == E_POINTER, "RequestRuntimeLoadedNotification returned %x\n", hr);
ok(hr == E_POINTER, "RequestRuntimeLoadedNotification returned %lx\n", hr);
hr = ICLRMetaHost_RequestRuntimeLoadedNotification(metahost,notification_callback);
ok(hr == S_OK, "RequestRuntimeLoadedNotification failed, hr=%x\n", hr);
ok(hr == S_OK, "RequestRuntimeLoadedNotification failed, hr=%lx\n", hr);
hr = ICLRMetaHost_RequestRuntimeLoadedNotification(metahost,notification_dummy_callback);
ok(hr == HOST_E_INVALIDOPERATION, "RequestRuntimeLoadedNotification returned %x\n", hr);
ok(hr == HOST_E_INVALIDOPERATION, "RequestRuntimeLoadedNotification returned %lx\n", hr);
}
static void test_notification_cb(void)
......@@ -205,12 +205,12 @@ static void test_notification_cb(void)
ICLRRuntimeHost *host;
hr = ICLRMetaHost_GetRuntime(metahost, v4_0, &IID_ICLRRuntimeInfo, (void**)&info);
ok(hr == S_OK, "GetRuntime returned %x\n", hr);
ok(hr == S_OK, "GetRuntime returned %lx\n", hr);
expect_runtime_tid = GetCurrentThreadId();
hr = ICLRRuntimeInfo_GetInterface(info, &CLSID_CLRRuntimeHost, &IID_ICLRRuntimeHost, (void**)&host);
todo_wine_if(!has_mono) ok(hr == S_OK, "GetInterface returned %x\n", hr);
todo_wine_if(!has_mono) ok(hr == S_OK, "GetInterface returned %lx\n", hr);
todo_wine if(!has_mono) ok(expect_runtime_tid == 0, "notification_callback was not called\n");
if(has_mono)
......
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