Commit 72dc82c0 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

sxs/tests: Use wide character string literals.

parent 755f6a0a
......@@ -27,60 +27,8 @@
static void test_QueryAssemblyInfo( void )
{
static const WCHAR emptyW[] = {0};
static const WCHAR wine1W[] = {'w','i','n','e',0};
static const WCHAR wine2W[] =
{'w','i','n','e',',',
'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine3W[] =
{'w','i','n','e',',',
'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',0};
static const WCHAR wine4W[] =
{'w','i','n','e',',',
'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',0};
static const WCHAR wine5W[] =
{'w','i','n','e',',',
'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'\"','1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','\"',0};
static const WCHAR comctl1W[] =
{'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
'v','e','r','s','i','o','n','=','\"','6','.','0','.','2','6','0','0','.','2','9','8','2','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
static const WCHAR comctl2W[] =
{'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
'v','e','r','s','i','o','n','=','\"','6','.','0','.','3','7','9','0','.','4','7','7','0','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
static const WCHAR comctl3W[] =
{'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
'v','e','r','s','i','o','n','=','\"','6','.','0','.','8','2','5','0','.','0','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
static const WCHAR comctl4W[] =
{'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
'v','e','r','s','i','o','n','=','\"','6','.','0','.','7','6','0','1','.','1','7','5','1','4','\"',',',
't','y','p','e','=','\"','w','i','n','3','2','\"',',',
'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
'\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
static const WCHAR wineW[] =
L"wine,version=\"1.2.3.4\",type=\"win32\",processorArchitecture=\"x86\",publicKeyToken=\"1234567890abcdef\"";
HRESULT hr;
ASSEMBLY_INFO info;
IAssemblyCache *cache = NULL;
......@@ -95,25 +43,26 @@ static void test_QueryAssemblyInfo( void )
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, NULL, NULL );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, emptyW, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, L"", NULL );
ok( hr == E_INVALIDARG, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine1W, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, L"wine", NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == E_INVALIDARG) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine2W, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, L"wine,version=\"1.2.3.4\"", NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine3W, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, L"wine,version=\"1.2.3.4\",type=\"win32\"", NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE ) ||
broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine4W, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, L"wine,version=\"1.2.3.4\",type=\"win32\",processorArchitecture=\"x86\"",
NULL );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, NULL );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wineW, NULL );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
GetWindowsDirectoryA( comctl_path1, MAX_PATH );
......@@ -124,10 +73,18 @@ static void test_QueryAssemblyInfo( void )
lstrcatA( comctl_path3, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.8250.0_none_c119e7cca62b92bd" );
GetWindowsDirectoryA( comctl_path4, MAX_PATH );
lstrcatA( comctl_path4, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2" );
if (GetFileAttributesA( comctl_path1 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl1W;
else if (GetFileAttributesA( comctl_path2 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl2W;
else if (GetFileAttributesA( comctl_path3 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl3W;
else if (GetFileAttributesA( comctl_path4 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl4W;
if (GetFileAttributesA( comctl_path1 ) != INVALID_FILE_ATTRIBUTES)
comctlW = L"microsoft.windows.common-controls,version=\"6.0.2600.2982\",type=\"win32\",processorArchitecture=\"x86\","
"publicKeyToken=\"6595b64144ccf1df\"";
else if (GetFileAttributesA( comctl_path2 ) != INVALID_FILE_ATTRIBUTES)
comctlW = L"microsoft.windows.common-controls,version=\"6.0.3790.4770\",type=\"win32\",processorArchitecture=\"x86\","
"publicKeyToken=\"6595b64144ccf1df\"";
else if (GetFileAttributesA( comctl_path3 ) != INVALID_FILE_ATTRIBUTES)
comctlW = L"microsoft.windows.common-controls,version=\"6.0.8250.0\",type=\"win32\",processorArchitecture=\"x86\","
"publicKeyToken=\"6595b64144ccf1df\"";
else if (GetFileAttributesA( comctl_path4 ) != INVALID_FILE_ATTRIBUTES)
comctlW = L"microsoft.windows.common-controls,version=\"6.0.7601.17514\",type=\"win32\",processorArchitecture=\"x86\","
"publicKeyToken=\"6595b64144ccf1df\"";
else
{
skip( "no assembly to test with\n" );
......@@ -140,7 +97,7 @@ static void test_QueryAssemblyInfo( void )
memset( &info, 0, sizeof(info) );
info.cbAssemblyInfo = sizeof(info);
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, &info );
hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wineW, &info );
todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08lx\n", hr );
memset( &info, 0, sizeof(info) );
......
......@@ -26,34 +26,13 @@
#include "wine/test.h"
static const WCHAR wine1W[] =
{'w','i','n','e',0};
static const WCHAR wine2W[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine3W[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=','1','.','2','.','3','.','4',0};
static const WCHAR wine4W[] =
{'w','i','n','e',',',' ','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine5W[] =
{'w','i','n','e',',','v','e','r','s','i','o','n',' ','=','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine6W[] =
{'w','i','n','e',',','v','e','r','s','i','o','n','=',' ','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine7W[] =
{'w','i','n','e',' ',',','v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
static const WCHAR wine8W[] =
{'w','i','n','e',',','v','e','r','s','i','o','n',0};
static const WCHAR wine9W[] =
{'w','i','n','e',',','t','y','p','e','=','\"','\"',0};
static const WCHAR wine10W[] =
{'w','i','n','e',',','t','y','p','e','=','\"','w','i','n','3','2',0};
static void test_CreateAssemblyNameObject( void )
{
static const WCHAR emptyW[] = {0};
IAssemblyName *name;
HRESULT hr;
hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( NULL, L"wine", CANOF_PARSE_DISPLAY_NAME, NULL );
ok(hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr);
name = (IAssemblyName *)0xdeadbeef;
......@@ -77,12 +56,12 @@ static void test_CreateAssemblyNameObject( void )
ok( !name, "expected NULL got %p\n", name );
name = NULL;
hr = CreateAssemblyNameObject( &name, wine1W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "expected S_OK got %08lx\n", hr );
ok( name != NULL, "expected non-NULL name\n" );
IAssemblyName_Release( name );
hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_SET_DEFAULT_VALUES, NULL );
hr = CreateAssemblyNameObject( NULL, L"wine", CANOF_SET_DEFAULT_VALUES, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
name = (IAssemblyName *)0xdeadbeef;
......@@ -106,11 +85,11 @@ static void test_CreateAssemblyNameObject( void )
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine1W, CANOF_SET_DEFAULT_VALUES, NULL );
hr = CreateAssemblyNameObject( &name, L"wine", CANOF_SET_DEFAULT_VALUES, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
hr = CreateAssemblyNameObject( NULL, wine1W, 0, NULL );
hr = CreateAssemblyNameObject( NULL, L"wine", 0, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
name = (IAssemblyName *)0xdeadbeef;
......@@ -134,10 +113,10 @@ static void test_CreateAssemblyNameObject( void )
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine1W, 0, NULL );
hr = CreateAssemblyNameObject( &name, L"wine", 0, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
hr = CreateAssemblyNameObject( NULL, wine1W, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( NULL, L"wine", CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
name = (IAssemblyName *)0xdeadbeef;
......@@ -161,57 +140,57 @@ static void test_CreateAssemblyNameObject( void )
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine1W, CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine", CANOF_SET_DEFAULT_VALUES|CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = NULL;
hr = CreateAssemblyNameObject( &name, wine2W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,version=\"1.2.3.4\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "expected S_OK got %08lx\n", hr );
ok( name != NULL, "expected non-NULL name\n" );
IAssemblyName_Release( name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine3W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,version=1.2.3.4", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine4W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine, version=\"1.2.3.4\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME ),
"expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine5W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,version =\"1.2.3.4\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == HRESULT_FROM_WIN32( ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME ),
"expected ERROR_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine6W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,version= \"1.2.3.4\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = NULL;
hr = CreateAssemblyNameObject( &name, wine7W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine ,version=\"1.2.3.4\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "expected S_OK got %08lx\n", hr );
ok( name != NULL, "expected non-NULL name\n" );
IAssemblyName_Release( name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine8W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,version", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
name = NULL;
hr = CreateAssemblyNameObject( &name, wine9W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,type=\"\"", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == S_OK, "expected S_OK got %08lx\n", hr );
ok( name != NULL, "expected non-NULL name\n" );
IAssemblyName_Release( name );
name = (IAssemblyName *)0xdeadbeef;
hr = CreateAssemblyNameObject( &name, wine10W, CANOF_PARSE_DISPLAY_NAME, NULL );
hr = CreateAssemblyNameObject( &name, L"wine,type=\"win32", CANOF_PARSE_DISPLAY_NAME, NULL );
ok( hr == E_INVALIDARG, "expected E_INVALIDARG got %08lx\n", hr );
ok( !name, "expected NULL got %p\n", name );
}
......
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