Commit 058ca3d0 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

msi/tests: Use wide character string literals.

parent c4fc91f4
......@@ -106,9 +106,6 @@ static void check_prop(MSIHANDLE hinst, const char *prop, const char *expect)
static void test_props(MSIHANDLE hinst)
{
static const WCHAR booW[] = {'b','o','o',0};
static const WCHAR xyzW[] = {'x','y','z',0};
static const WCHAR xyW[] = {'x','y',0};
char buffer[10];
WCHAR bufferW[10];
DWORD sz;
......@@ -219,43 +216,43 @@ static void test_props(MSIHANDLE hinst)
ok(hinst, !strcmp(buffer, "xyz"), "got \"%s\"\n", buffer);
ok(hinst, sz == 3, "got size %u\n", sz);
r = MsiGetPropertyW(hinst, booW, NULL, NULL);
r = MsiGetPropertyW(hinst, L"boo", NULL, NULL);
ok(hinst, !r, "got %u\n", r);
r = MsiGetPropertyW(hinst, booW, bufferW, NULL );
r = MsiGetPropertyW(hinst, L"boo", bufferW, NULL );
ok(hinst, r == ERROR_INVALID_PARAMETER, "got %u\n", r);
sz = 0;
r = MsiGetPropertyW(hinst, booW, NULL, &sz);
r = MsiGetPropertyW(hinst, L"boo", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
lstrcpyW(bufferW, booW);
r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, booW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"boo"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 1;
lstrcpyW(bufferW, booW);
r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 3;
lstrcpyW(bufferW, booW);
r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"xy"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 4;
lstrcpyW(bufferW, booW);
r = MsiGetPropertyW(hinst, booW, bufferW, &sz);
lstrcpyW(bufferW, L"boo");
r = MsiGetPropertyW(hinst, L"boo", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"xyz"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
r = MsiSetPropertyA(hinst, "boo", NULL);
......@@ -566,9 +563,6 @@ UINT WINAPI nested(MSIHANDLE hinst)
static void test_targetpath(MSIHANDLE hinst)
{
static const WCHAR targetdirW[] = {'T','A','R','G','E','T','D','I','R',0};
static const WCHAR xyzW[] = {'C',':','\\',0};
static const WCHAR xyW[] = {'C',':',0};
WCHAR bufferW[100];
char buffer[100];
DWORD sz, srcsz;
......@@ -621,36 +615,36 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
r = MsiGetTargetPathW(hinst, targetdirW, NULL, &sz);
r = MsiGetTargetPathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 3;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
sz = 4;
bufferW[0] = 'q';
r = MsiGetTargetPathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetTargetPathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"C:\\"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 3, "got size %u\n", sz);
r = MsiSetTargetPathA(hinst, NULL, "C:\\subdir");
......@@ -684,7 +678,7 @@ static void test_targetpath(MSIHANDLE hinst)
* Seems to be a casualty of RPC... */
srcsz = 0;
MsiGetSourcePathW(hinst, targetdirW, NULL, &srcsz);
MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &srcsz);
sz = 0;
r = MsiGetSourcePathA(hinst, "TARGETDIR", NULL, &sz);
......@@ -720,34 +714,34 @@ static void test_targetpath(MSIHANDLE hinst)
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 0;
r = MsiGetSourcePathW(hinst, targetdirW, NULL, &sz);
r = MsiGetSourcePathW(hinst, L"TARGETDIR", NULL, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 0;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = srcsz;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz - 1, "wrong buffer length %d\n", lstrlenW(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
sz = srcsz + 1;
bufferW[0] = 'q';
r = MsiGetSourcePathW(hinst, targetdirW, bufferW, &sz);
r = MsiGetSourcePathW(hinst, L"TARGETDIR", bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, lstrlenW(bufferW) == srcsz, "wrong buffer length %d\n", lstrlenW(bufferW));
ok(hinst, sz == srcsz, "got size %u\n", sz);
......@@ -870,8 +864,6 @@ static void test_feature_states(MSIHANDLE hinst)
static void test_format_record(MSIHANDLE hinst)
{
static const WCHAR xyzW[] = {'f','o','o',' ','1','2','3',0};
static const WCHAR xyW[] = {'f','o','o',' ','1','2',0};
WCHAR bufferW[10];
char buffer[10];
MSIHANDLE rec;
......@@ -955,14 +947,14 @@ static void test_format_record(MSIHANDLE hinst)
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"foo 12"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 7, "got size %u\n", sz);
sz = 8;
bufferW[0] = 'q';
r = MsiFormatRecordW(hinst, rec, bufferW, &sz);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"foo 123"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 7, "got size %u\n", sz);
/* check that properties work */
......@@ -979,9 +971,6 @@ static void test_format_record(MSIHANDLE hinst)
static void test_costs(MSIHANDLE hinst)
{
static const WCHAR oneW[] = {'O','n','e',0};
static const WCHAR xyzW[] = {'C',':',0};
static const WCHAR xyW[] = {'C',0};
WCHAR bufferW[10];
char buffer[10];
int cost, temp;
......@@ -1085,30 +1074,30 @@ static void test_costs(MSIHANDLE hinst)
sz = 0;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, bufferW[0] == 'q', "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 1;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !bufferW[0], "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 2;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, r == ERROR_MORE_DATA, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"C"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
sz = 3;
bufferW[0] = 'q';
r = MsiEnumComponentCostsW(hinst, oneW, 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
r = MsiEnumComponentCostsW(hinst, L"One", 0, INSTALLSTATE_LOCAL, bufferW, &sz, &cost, &temp);
ok(hinst, !r, "got %u\n", r);
ok(hinst, !lstrcmpW(bufferW, xyzW), "got %s\n", dbgstr_w(bufferW));
ok(hinst, !lstrcmpW(bufferW, L"C:"), "got %s\n", dbgstr_w(bufferW));
ok(hinst, sz == 2, "got size %u\n", sz);
}
......
......@@ -33,8 +33,8 @@
static const char *msifile = "winetest-db.msi";
static const char *msifile2 = "winetst2-db.msi";
static const char *mstfile = "winetst-db.mst";
static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','-','d','b','.','m','s','i',0};
static const WCHAR msifile2W[] = {'w','i','n','e','t','s','t','2','-','d','b','.','m','s','i',0};
static const WCHAR msifileW[] = L"winetest-db.msi";
static const WCHAR msifile2W[] = L"winetst2-db.msi";
static void WINAPIV check_record_(int line, MSIHANDLE rec, UINT count, ...)
{
......@@ -1428,7 +1428,7 @@ static void test_msiexport(void)
static void test_longstrings(void)
{
const char insert_query[] =
const char insert_query[] =
"INSERT INTO `strings` ( `id`, `val` ) VALUES('1', 'Z')";
char *str;
MSIHANDLE hdb = 0, hview = 0, hrec = 0;
......@@ -1442,7 +1442,7 @@ static void test_longstrings(void)
ok(r == ERROR_SUCCESS, "MsiOpenDatabase failed\n");
/* create a table */
r = try_query( hdb,
r = try_query( hdb,
"CREATE TABLE `strings` ( `id` INT, `val` CHAR(0) PRIMARY KEY `id`)");
ok(r == ERROR_SUCCESS, "query failed\n");
......@@ -1507,7 +1507,7 @@ static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
}
#define create_file(name) create_file_data(name, name, 0)
static void test_streamtable(void)
{
MSIHANDLE hdb = 0, rec, view, hsi;
......@@ -2740,7 +2740,7 @@ static void test_handle_limit(void)
static char szQueryBuf[256] = "SELECT * from `_Tables`";
hviews[i] = 0xdeadbeeb;
r = MsiDatabaseOpenViewA(hdb, szQueryBuf, &hviews[i]);
if( r != ERROR_SUCCESS || hviews[i] == 0xdeadbeeb ||
if( r != ERROR_SUCCESS || hviews[i] == 0xdeadbeeb ||
hviews[i] == 0 || (i && (hviews[i] == hviews[i-1])))
break;
}
......@@ -4776,34 +4776,6 @@ static void test_rows_order(void)
static void test_collation(void)
{
static const WCHAR query1[] =
{'I','N','S','E','R','T',' ','I','N','T','O',' ','`','b','a','r','`',' ',
'(','`','f','o','o','`',',','`','b','a','z','`',')',' ','V','A','L','U','E','S',' ',
'(','\'','a',0x30a,'\'',',','\'','C','\'',')',0};
static const WCHAR query2[] =
{'I','N','S','E','R','T',' ','I','N','T','O',' ','`','b','a','r','`',' ',
'(','`','f','o','o','`',',','`','b','a','z','`',')',' ','V','A','L','U','E','S',' ',
'(','\'',0xe5,'\'',',','\'','D','\'',')',0};
static const WCHAR query3[] =
{'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','b','a','z','`',' ',
'(',' ','`','a',0x30a,'`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ','N','U','L','L',',',
' ','`',0xe5,'`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ','N','U','L','L',' ',
'P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','a',0x30a,'`',')',0};
static const WCHAR query4[] =
{'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`','a',0x30a,'`',' ',
'(',' ','`','f','o','o','`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ',
'N','U','L','L',' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','f','o','o','`',')',0};
static const WCHAR query5[] =
{'C','R','E','A','T','E',' ','T','A','B','L','E',' ','`',0xe5,'`',' ',
'(',' ','`','f','o','o','`',' ','L','O','N','G','C','H','A','R',' ','N','O','T',' ',
'N','U','L','L',' ','P','R','I','M','A','R','Y',' ','K','E','Y',' ','`','f','o','o','`',')',0};
static const WCHAR query6[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','b','a','r','`',' ','W','H','E','R','E',
' ','`','f','o','o','`',' ','=','\'',0xe5,'\'',0};
static const WCHAR letter_C[] = {'C',0};
static const WCHAR letter_D[] = {'D',0};
static const WCHAR letter_a_ring[] = {'a',0x30a,0};
static const WCHAR letter_a_with_ring[] = {0xe5,0};
const char *query;
MSIHANDLE hdb = 0, hview = 0, hrec = 0;
UINT r;
......@@ -4832,19 +4804,19 @@ static void test_collation(void)
"( `foo`, `baz` ) VALUES ( '\1', 'B' )");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
r = run_queryW(hdb, 0, query1);
r = run_queryW(hdb, 0, L"INSERT INTO `bar` (`foo`,`baz`) VALUES ('a\x30a','C')");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
r = run_queryW(hdb, 0, query2);
r = run_queryW(hdb, 0, L"INSERT INTO `bar` (`foo`,`baz`) VALUES ('\xe5','D')");
ok(r == ERROR_SUCCESS, "cannot add value to table %u\n", r);
r = run_queryW(hdb, 0, query3);
r = run_queryW(hdb, 0, L"CREATE TABLE `baz` ( `a\x30a` LONGCHAR NOT NULL, `\xe5` LONGCHAR NOT NULL PRIMARY KEY `a\x30a`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
r = run_queryW(hdb, 0, query4);
r = run_queryW(hdb, 0, L"CREATE TABLE `a\x30a` ( `foo` LONGCHAR NOT NULL PRIMARY KEY `foo`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
r = run_queryW(hdb, 0, query5);
r = run_queryW(hdb, 0, L"CREATE TABLE `\xe5` ( `foo` LONGCHAR NOT NULL PRIMARY KEY `foo`)");
ok(r == ERROR_SUCCESS, "cannot create table %u\n", r);
query = "SELECT * FROM `bar`";
......@@ -4882,12 +4854,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_ring, sizeof(letter_a_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_ring), wine_dbgstr_w(bufferW));
ok(!memcmp(bufferW, L"a\x30a", sizeof(L"a\x30a")),
"Expected %s, got %s\n", wine_dbgstr_w(L"a\x30a"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_C), "Expected C, got %s\n", wine_dbgstr_w(bufferW));
ok(!lstrcmpW(bufferW, L"C"), "Expected C, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewFetch(hview, &hrec);
......@@ -4895,12 +4867,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
ok(!memcmp(bufferW, L"\xe5", sizeof(L"\xe5")),
"Expected %s, got %s\n", wine_dbgstr_w(L"\xe5"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
ok(!lstrcmpW(bufferW, L"D"), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewClose(hview);
......@@ -4908,7 +4880,7 @@ static void test_collation(void)
r = MsiCloseHandle(hview);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
r = MsiDatabaseOpenViewW(hdb, query6, &hview);
r = MsiDatabaseOpenViewW(hdb, L"SELECT * FROM `bar` WHERE `foo` ='\xe5'", &hview);
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
r = MsiViewExecute(hview, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
......@@ -4918,12 +4890,12 @@ static void test_collation(void)
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 1, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!memcmp(bufferW, letter_a_with_ring, sizeof(letter_a_with_ring)),
"Expected %s, got %s\n", wine_dbgstr_w(letter_a_with_ring), wine_dbgstr_w(bufferW));
ok(!memcmp(bufferW, L"\xe5", sizeof(L"\xe5")),
"Expected %s, got %s\n", wine_dbgstr_w(L"\xe5"), wine_dbgstr_w(bufferW));
sz = ARRAY_SIZE(bufferW);
r = MsiRecordGetStringW(hrec, 2, bufferW, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpW(bufferW, letter_D), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
ok(!lstrcmpW(bufferW, L"D"), "Expected D, got %s\n", wine_dbgstr_w(bufferW));
MsiCloseHandle(hrec);
r = MsiViewFetch(hview, &hrec);
......@@ -7539,7 +7511,6 @@ static void test_droptable(void)
static void test_dbmerge(void)
{
static const WCHAR refdbW[] = {'r','e','f','d','b','.','m','s','i',0};
MSIHANDLE hdb, href, hview, hrec;
CHAR buf[MAX_PATH];
LPCSTR query;
......@@ -7549,7 +7520,7 @@ static void test_dbmerge(void)
r = MsiOpenDatabaseW(msifileW, MSIDBOPEN_CREATE, &hdb);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiOpenDatabaseW(refdbW, MSIDBOPEN_CREATE, &href);
r = MsiOpenDatabaseW(L"refdb.msi", MSIDBOPEN_CREATE, &href);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* hDatabase is invalid */
......@@ -8090,7 +8061,7 @@ static void test_dbmerge(void)
MsiCloseHandle(hdb);
MsiCloseHandle(href);
DeleteFileA(msifile);
DeleteFileW(refdbW);
DeleteFileW(L"refdb.msi");
DeleteFileA("codepage.idt");
DeleteFileA("binary.dat");
}
......
......@@ -59,8 +59,8 @@ static const char *msifile = "msitest.msi";
static const char *msifile2 = "winetest2.msi";
static const char *mstfile = "winetest.mst";
static const WCHAR msifileW[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
static const WCHAR msifile2W[] = {'w','i','n','e','t','e','s','t','2','.','m','s','i',0};
static const WCHAR msifileW[] = L"msitest.msi";
static const WCHAR msifile2W[] = L"msitest2.msi";
char CURR_DIR[MAX_PATH];
char PROG_FILES_DIR[MAX_PATH];
......@@ -2209,7 +2209,7 @@ static LONG CDECL fci_seek(INT_PTR hf, LONG dist, int seektype, int *err, void *
{
HANDLE handle = (HANDLE)hf;
DWORD ret;
ret = SetFilePointer(handle, dist, NULL, seektype);
ok(ret != INVALID_SET_FILE_POINTER, "Failed to SetFilePointer\n");
......@@ -3995,11 +3995,6 @@ static void set_admin_property_stream(LPCSTR file)
DWORD count;
const DWORD mode = STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE;
/* AdminProperties */
static const WCHAR stmname[] = {0x41ca,0x4330,0x3e71,0x44b5,0x4233,0x45f5,0x422c,0x4836,0};
static const WCHAR data[] = {'M','Y','P','R','O','P','=','2','7','1','8',' ',
'M','y','P','r','o','p','=','4','2',0};
MultiByteToWideChar(CP_ACP, 0, file, -1, fileW, MAX_PATH);
hr = StgOpenStorage(fileW, NULL, mode, NULL, 0, &stg);
......@@ -4007,10 +4002,11 @@ static void set_admin_property_stream(LPCSTR file)
if (!stg)
return;
hr = IStorage_CreateStream(stg, stmname, STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
hr = IStorage_CreateStream(stg, L"\x41ca\x4330\x3e71\x44b5\x4233\x45f5\x422c\x4836",
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
hr = IStream_Write(stm, data, sizeof(data), &count);
hr = IStream_Write(stm, L"MYPROP=2718 MyProp=42", sizeof(L"MYPROP=2718 MyProp=42"), &count);
ok(hr == S_OK, "Expected S_OK, got %d\n", hr);
IStream_Release(stm);
......@@ -4983,9 +4979,6 @@ error:
static void test_int_widths( void )
{
static const WCHAR msitestW[] = {'m','s','i','t','e','s','t','.','m','s','i',0};
static const WCHAR msitableW[] = {'m','s','i','t','a','b','l','e','.','i','d','t',0};
static const WCHAR slashW[] = {'\\',0};
static const char int0[] = "int0\ni0\nint0\tint0\n1";
static const char int1[] = "int1\ni1\nint1\tint1\n1";
static const char int2[] = "int2\ni2\nint2\tint2\n1";
......@@ -5017,12 +5010,10 @@ static void test_int_widths( void )
CreateDirectoryW(tmpdir, NULL);
lstrcpyW(msitable, tmpdir);
lstrcatW(msitable, slashW);
lstrcatW(msitable, msitableW);
lstrcatW(msitable, L"\\msitable.idt");
lstrcpyW(msidb, tmpdir);
lstrcatW(msidb, slashW);
lstrcatW(msidb, msitestW);
lstrcatW(msidb, L"\\msitest.msi");
r = MsiOpenDatabaseW(msidb, MSIDBOPEN_CREATE, &db);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
......@@ -5035,7 +5026,7 @@ static void test_int_widths( void )
WriteFile(handle, tests[i].data, tests[i].size, &count, NULL);
CloseHandle(handle);
r = MsiDatabaseImportW(db, tmpdir, msitableW);
r = MsiDatabaseImportW(db, tmpdir, L"msitable.idt");
ok(r == tests[i].ret, " %u expected %u, got %u\n", i, tests[i].ret, r);
r = MsiDatabaseCommit(db);
......
......@@ -39,7 +39,7 @@
static BOOL is_wow64;
static const char msifile[] = "winetest.msi";
static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','.','m','s','i',0};
static const WCHAR msifileW[] = L"winetest.msi";
static LONG (WINAPI *pRegDeleteKeyExA)(HKEY, LPCSTR, REGSAM, DWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL);
......@@ -892,19 +892,19 @@ static void test_usefeature(void)
r = pMsiUseFeatureExA(NULL, "WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
NULL, -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
r = pMsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
r = pMsiUseFeatureExA("{9085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
r = pMsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
r = pMsiUseFeatureExA("{0085040-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 0 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
r = pMsiUseFeatureExA("{90850409-6000-11d3-8cfe-0150048383c9}",
"WORDVIEWFiles", -2, 1 );
ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n");
}
......@@ -3379,14 +3379,6 @@ static void test_MsiGetComponentPathEx(void)
static void test_MsiProvideComponent(void)
{
static const WCHAR sourcedirW[] =
{'s','o','u','r','c','e','d','i','r',0};
static const WCHAR productW[] =
{'{','3','8','8','4','7','3','3','8','-','1','B','B','C','-','4','1','0','4','-',
'8','1','A','C','-','2','F','A','A','C','7','E','C','D','D','C','D','}',0};
static const WCHAR componentW[] =
{'{','D','D','4','2','2','F','9','2','-','3','E','D','8','-','4','9','B','5','-',
'A','0','B','7','-','F','2','6','6','F','9','8','3','5','7','D','F','}',0};
INSTALLSTATE state;
char buf[0x100];
WCHAR bufW[0x100];
......@@ -3445,21 +3437,21 @@ static void test_MsiProvideComponent(void)
bufW[0] = 0;
len = sizeof(buf);
r = pMsiProvideComponentW(productW, sourcedirW, componentW,
INSTALLMODE_NODETECTION, bufW, &len);
r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(bufW[0], "empty path\n");
ok(len == lstrlenW(bufW), "got %u\n", len);
len2 = 0;
r = pMsiProvideComponentW(productW, sourcedirW, componentW,
INSTALLMODE_NODETECTION, NULL, &len2);
r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, NULL, &len2);
ok(r == ERROR_SUCCESS, "got %u\n", r);
ok(len2 == len, "got %u\n", len2);
len2 = 0;
r = pMsiProvideComponentW(productW, sourcedirW, componentW,
INSTALLMODE_NODETECTION, bufW, &len2);
r = pMsiProvideComponentW(L"{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}", L"sourcedir",
L"{DD422F92-3ED8-49B5-A0B7-F266F98357DF}", INSTALLMODE_NODETECTION, bufW, &len2);
ok(r == ERROR_MORE_DATA, "got %u\n", r);
ok(len2 == len, "got %u\n", len2);
......
......@@ -39,10 +39,8 @@ static UINT (WINAPI *pMsiEnumPatchesExA)( LPCSTR, LPCSTR, DWORD, DWORD, DWORD, L
static const char *msifile = "winetest-patch.msi";
static const char *mspfile = "winetest-patch.msp";
static const WCHAR msifileW[] =
{'w','i','n','e','t','e','s','t','-','p','a','t','c','h','.','m','s','i',0};
static const WCHAR mspfileW[] =
{'w','i','n','e','t','e','s','t','-','p','a','t','c','h','.','m','s','p',0};
static const WCHAR msifileW[] = L"winetest-patch.msi";
static const WCHAR mspfileW[] = L"winetest-patch.msp";
static char CURR_DIR[MAX_PATH];
static char PROG_FILES_DIR[MAX_PATH];
......@@ -1001,14 +999,11 @@ static UINT find_entry( MSIHANDLE hdb, const char *table, const char *entry )
static UINT find_entryW( MSIHANDLE hdb, const WCHAR *table, const WCHAR *entry )
{
static const WCHAR fmt[] =
{'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','%','s','`',' ',
'W','H','E','R','E',' ','`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0};
WCHAR query[0x100];
MSIHANDLE hview, hrec;
UINT r;
wsprintfW( query, fmt, table, entry );
wsprintfW( query, L"SELECT * FROM `%s` WHERE `Name` = '%s'", table, entry );
r = MsiDatabaseOpenViewW( hdb, query, &hview );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
......@@ -1086,8 +1081,6 @@ static char *get_string( MSIHANDLE hdb, UINT field, const char *query)
static void test_system_tables( void )
{
static const char patchsource[] = "MSPSRC0F96CDC04CDF4304B2837B9264889EF7";
static const WCHAR streamsW[] = {'_','S','t','r','e','a','m','s',0};
static const WCHAR CAB_msitest_encodedW[] = {0x3a8c,0x47cb,0x45b0,0x45ec,0x45a8,0x4837,0};
UINT r;
char *cr;
const char *query;
......@@ -1193,7 +1186,7 @@ static void test_system_tables( void )
r = find_entry( hdb, "_Streams", "\5SummaryInformation" );
ok( r == ERROR_SUCCESS, "failed to find entry %u\n", r );
r = find_entryW( hdb, streamsW, CAB_msitest_encodedW );
r = find_entryW( hdb, L"_Streams", L"\x3a8c\x47cb\x45b0\x45ec\x45a8\x4837" );
ok( r == ERROR_NO_MORE_ITEMS, "failed to find entry %u\n", r );
query = "SELECT * FROM `_Storages`";
......
......@@ -25,8 +25,7 @@
#include "wine/test.h"
static const char *msifile = "winetest-record.msi";
static const WCHAR msifileW[] =
{'w','i','n','e','t','e','s','t','-','r','e','c','o','r','d','.','m','s','i',0};
static const WCHAR msifileW[] = L"winetest-record.msi";
static BOOL create_temp_file(char *name)
{
......@@ -34,7 +33,7 @@ static BOOL create_temp_file(char *name)
unsigned char buffer[26], i;
DWORD sz;
HANDLE handle;
r = GetTempFileNameA(".", "msitest",0,name);
if(!r)
return r;
......@@ -338,7 +337,7 @@ static void test_msirecord(void)
ok(r == ERROR_SUCCESS, "Failed to close handle\n");
/* now try streams in a new record - need to create a file to play with */
r = create_temp_file(filename);
r = create_temp_file(filename);
if(!r)
return;
......
......@@ -64,8 +64,7 @@
#define PID_MSIRESTRICT PID_CHARCOUNT
static const char *msifile = "winetest-suminfo.msi";
static const WCHAR msifileW[] = {
'w','i','n','e','t','e','s','t','-','s','u','m','i','n','f','o','.','m','s','i',0 };
static const WCHAR msifileW[] = L"winetest-suminfo.msi";
static void test_suminfo(void)
{
......
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