Commit 0dabbc15 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

sxs/tests: Enable compilation with long types.

parent d046c3fc
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = sxs.dll
IMPORTS = sxs shlwapi
......
......@@ -89,32 +89,32 @@ static void test_QueryAssemblyInfo( void )
const WCHAR *comctlW;
hr = CreateAssemblyCache( &cache, 0 );
ok( hr == S_OK, "got %08x\n", hr );
ok( cache != NULL, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
ok( cache != NULL, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, NULL, NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, emptyW, NULL );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine1W, NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == E_INVALIDARG) /* winxp */, "got %08x\n", hr );
broken(hr == E_INVALIDARG) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine2W, NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08x\n", hr );
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine3W, NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08x\n", hr );
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine4W, NULL );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, NULL );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
GetWindowsDirectoryA( comctl_path1, MAX_PATH );
lstrcatA( comctl_path1, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef" );
......@@ -136,31 +136,31 @@ static void test_QueryAssemblyInfo( void )
}
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, NULL );
ok( hr == S_OK, "got %08x\n", hr );
ok( hr == S_OK, "got %08lx\n", hr );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, &info );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
ok( hr == S_OK, "got %08x\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( hr == S_OK, "got %08lx\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
ok( !info.cchBuf, "got %u\n", info.cchBuf );
ok( !info.cchBuf, "got %lu\n", info.cchBuf );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
info.pszCurrentAssemblyPathBuf = path;
info.cchBuf = ARRAY_SIZE( path );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
ok( hr == S_OK, "got %08x\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf == ARRAY_SIZE( path ), "got %u\n", info.cchBuf );
ok( hr == S_OK, "got %08lx\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf == ARRAY_SIZE( path ), "got %lu\n", info.cchBuf );
ok( path[0], "empty path\n" );
lstrcatW( path, L"comctl32.dll" );
ok( GetFileAttributesW( path ) != INVALID_FILE_ATTRIBUTES, "%s should exist\n", wine_dbgstr_w( path ));
......@@ -169,28 +169,28 @@ static void test_QueryAssemblyInfo( void )
info.cbAssemblyInfo = sizeof(info);
info.pszCurrentAssemblyPathBuf = path;
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
ok( hr == HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ), "got %08x\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf, "got %u\n", info.cchBuf );
ok( hr == HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ), "got %08lx\n", hr );
ok( info.dwAssemblyFlags == 1, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf, "got %lu\n", info.cchBuf );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 1, comctlW, &info );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
ok( !info.dwAssemblyFlags, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
ok( !info.cchBuf, "got %u\n", info.cchBuf );
ok( !info.cchBuf, "got %lu\n", info.cchBuf );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
ok( !info.dwAssemblyFlags, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
ok( !info.cchBuf, "got %u\n", info.cchBuf );
ok( !info.cchBuf, "got %lu\n", info.cchBuf );
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
......@@ -198,10 +198,10 @@ static void test_QueryAssemblyInfo( void )
info.cchBuf = ARRAY_SIZE( path );
path[0] = 0;
hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info );
ok( hr == E_INVALIDARG, "got %08x\n", hr );
ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf == ARRAY_SIZE( path ), "got %u\n", info.cchBuf );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
ok( !info.dwAssemblyFlags, "got %08lx\n", info.dwAssemblyFlags );
ok( !info.uliAssemblySizeInKB.u.LowPart, "got %lu\n", info.uliAssemblySizeInKB.u.LowPart );
ok( info.cchBuf == ARRAY_SIZE( path ), "got %lu\n", info.cchBuf );
ok( !path[0], "got %s\n", wine_dbgstr_w(path) );
IAssemblyCache_Release( cache );
......
......@@ -90,31 +90,31 @@ static void run_test(void)
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY | SXS_LOOKUP_CLR_GUID_USE_ACTCTX, (GUID *)&CLSID_Test,
NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_NOT_FOUND, "Unexpected error %d.\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Unexpected error %ld.\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY | SXS_LOOKUP_CLR_GUID_USE_ACTCTX, (GUID *)&CLSID_Test,
NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_NOT_FOUND, "Unexpected error %d.\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Unexpected error %ld.\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY, (GUID*)&CLSID_Test, NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS, (GUID*)&CLSID_Test, NULL, NULL, 0, &buffer_size);
ok(ret == FALSE, "Got %d\n", ret);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %ld\n", GetLastError());
info = heap_alloc(buffer_size);
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS, (GUID*)&CLSID_Test, NULL, info, buffer_size, &buffer_size);
ok(ret == TRUE, "Got %d\n", ret);
ok(GetLastError() == 0, "Got %d\n", GetLastError());
ok(GetLastError() == 0, "Got %ld\n", GetLastError());
ok(info->dwFlags == SXS_GUID_INFORMATION_CLR_FLAG_IS_CLASS, "Got %d\n", info->dwFlags);
ok(info->dwFlags == SXS_GUID_INFORMATION_CLR_FLAG_IS_CLASS, "Got %ld\n", info->dwFlags);
ok(!lstrcmpW(info->pcwszTypeName, L"DLL.Test"), "Unexpected typename %s.\n", wine_dbgstr_w(info->pcwszTypeName));
ok(!lstrcmpW(info->pcwszAssemblyIdentity, L"comtest,type=\"win32\",version=\"1.0.0.0\""),
"Unexpected assembly identity %s.\n", wine_dbgstr_w(info->pcwszAssemblyIdentity));
......@@ -126,16 +126,16 @@ static void run_test(void)
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_SURROGATE, (GUID *)&CLSID_SurrogateTest, NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %ld\n", GetLastError());
info = heap_alloc(buffer_size);
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_SURROGATE, (GUID *)&CLSID_SurrogateTest, NULL, info,
buffer_size, &buffer_size);
ok(ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == 0, "Got %d\n", GetLastError());
ok(GetLastError() == 0, "Got %ld\n", GetLastError());
ok(info->dwFlags == SXS_GUID_INFORMATION_CLR_FLAG_IS_SURROGATE, "Unexpected flags %#x.\n", info->dwFlags);
ok(info->dwFlags == SXS_GUID_INFORMATION_CLR_FLAG_IS_SURROGATE, "Unexpected flags %#lx.\n", info->dwFlags);
ok(!lstrcmpW(info->pcwszTypeName, L"Surrogate.Test"), "Unexpected typename %s.\n", wine_dbgstr_w(info->pcwszTypeName));
ok(!lstrcmpW(info->pcwszAssemblyIdentity, L"comtest,type=\"win32\",version=\"1.0.0.0\""),
"Unexpected assembly identity %s.\n", wine_dbgstr_w(info->pcwszAssemblyIdentity));
......@@ -147,7 +147,7 @@ static void run_test(void)
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_ANY, (GUID *)&CLSID_SurrogateTest, NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got %ld\n", GetLastError());
}
static void prepare_and_run_test(void)
......@@ -180,7 +180,7 @@ static void prepare_and_run_test(void)
context.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID;
handle_context = CreateActCtxA(&context);
ok(handle_context != INVALID_HANDLE_VALUE, "CreateActCtxA failed: %d\n", GetLastError());
ok(handle_context != INVALID_HANDLE_VALUE, "CreateActCtxA failed: %ld\n", GetLastError());
if (handle_context == INVALID_HANDLE_VALUE)
{
......@@ -189,7 +189,7 @@ static void prepare_and_run_test(void)
}
success = ActivateActCtx(handle_context, &cookie);
ok(success, "ActivateActCtx failed: %d\n", GetLastError());
ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
run_test();
......@@ -197,18 +197,18 @@ cleanup:
if (handle_context != INVALID_HANDLE_VALUE)
{
success = DeactivateActCtx(0, cookie);
ok(success, "DeactivateActCtx failed: %d\n", GetLastError());
ok(success, "DeactivateActCtx failed: %ld\n", GetLastError());
ReleaseActCtx(handle_context);
}
if (*path_manifest_exe)
{
success = DeleteFileA(path_manifest_exe);
ok(success, "DeleteFileA failed: %d\n", GetLastError());
ok(success, "DeleteFileA failed: %ld\n", GetLastError());
}
if(*path_manifest_dll)
{
success = DeleteFileA(path_manifest_dll);
ok(success, "DeleteFileA failed: %d\n", GetLastError());
ok(success, "DeleteFileA failed: %ld\n", GetLastError());
}
}
......@@ -231,7 +231,7 @@ static void run_child_process(void)
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);
......@@ -247,18 +247,18 @@ static void test_SxsLookupClrGuid(void)
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS, (GUID*)&CLSID_Test, NULL, NULL, 0, &buffer_size);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %d\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS | SXS_LOOKUP_CLR_GUID_USE_ACTCTX, (GUID *)&CLSID_Test,
NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %d\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %ld\n", GetLastError());
SetLastError(0xdeadbeef);
ret = SxsLookupClrGuid(SXS_LOOKUP_CLR_GUID_FIND_SURROGATE, (GUID *)&CLSID_Test, NULL, NULL, 0, &buffer_size);
ok(!ret, "Unexpected return value %d.\n", ret);
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %d\n", GetLastError());
ok(GetLastError() == ERROR_NOT_FOUND, "Expected ERROR_NOT_FOUND, got %ld\n", GetLastError());
run_child_process();
}
......
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