Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msi/tests/automation.c | 273 +++++++++++++++--------------------- dlls/msi/tests/custom.c | 81 +++++------ dlls/msi/tests/db.c | 75 +++------- dlls/msi/tests/install.c | 27 ++-- dlls/msi/tests/msi.c | 30 ++-- dlls/msi/tests/package.c | 124 +++++++--------- dlls/msi/tests/patch.c | 15 +- dlls/msi/tests/record.c | 7 +- dlls/msi/tests/suminfo.c | 3 +- 9 files changed, 250 insertions(+), 385 deletions(-)
diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 7e5124c1a16..42c41dcd731 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -41,14 +41,6 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
static const char *msifile = "winetest-automation.msi"; -static const WCHAR szMsifile[] = {'w','i','n','e','t','e','s','t','-','a','u','t','o','m','a','t','i','o','n','.','m','s','i',0}; -static const WCHAR szMSITEST[] = { 'M','S','I','T','E','S','T',0 }; -static const WCHAR szProductCode[] = { '{','8','3','7','4','5','0','f','a','-','a','3','9','b','-','4','b','c','8','-','b','3','2','1','-','0','8','b','3','9','3','f','7','8','4','b','3','}',0 }; -static const WCHAR szUpgradeCode[] = { '{','C','E','0','6','7','E','8','D','-','2','E','1','A','-','4','3','6','7','-','B','7','3','4','-','4','E','B','2','B','D','A','D','6','5','6','5','}',0 }; -static const WCHAR szProductInfoException[] = { 'P','r','o','d','u','c','t','I','n','f','o',',','P','r','o','d','u','c','t',',','A','t','t','r','i','b','u','t','e',0 }; -static const WCHAR WINE_INSTALLPROPERTY_PACKAGENAMEW[] = {'P','a','c','k','a','g','e','N','a','m','e',0}; -static const WCHAR WINE_INSTALLPROPERTY_PRODUCTNAMEW[] = {'P','r','o','d','u','c','t','N','a','m','e',0}; -static const WCHAR WINE_INSTALLPROPERTY_LOCALPACKAGEW[] = {'L','o','c','a','l','P','a','c','k','a','g','e',0}; static FILETIME systemtime; static CHAR CURR_DIR[MAX_PATH]; static EXCEPINFO excepinfo; @@ -56,7 +48,6 @@ static EXCEPINFO excepinfo; /* * OLE automation data **/ -static const WCHAR szProgId[] = { 'W','i','n','d','o','w','s','I','n','s','t','a','l','l','e','r','.','I','n','s','t','a','l','l','e','r',0 }; static IDispatch *pInstaller;
/* msi database data */ @@ -345,7 +336,6 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
static BOOL create_package(LPWSTR path) { - static const WCHAR slashW[] = {'\',0}; DWORD len;
/* Prepare package */ @@ -357,8 +347,7 @@ static BOOL create_package(LPWSTR path) if (!len) return FALSE;
- lstrcatW(path, slashW); - lstrcatW(path, szMsifile); + lstrcatW(path, L"\winetest-automation.msi"); return TRUE; }
@@ -486,8 +475,6 @@ static CHAR string1[MAX_PATH], string2[MAX_PATH]; ok(0, format, extra, string1, aString); \
/* exception checker */ -static const WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0}; - #define ok_exception(hr, szDescription) \ if (hr == DISP_E_EXCEPTION) \ { \ @@ -496,7 +483,7 @@ static const WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o' \ ok(excepinfo.bstrSource != NULL, "Exception source was NULL\n"); \ if (excepinfo.bstrSource) \ - ok_w2("Exception source was "%s" but expected to be "%s"\n", excepinfo.bstrSource, szSource); \ + ok_w2("Exception source was "%s" but expected to be "%s"\n", excepinfo.bstrSource, L"Msi API Error"); \ \ ok(excepinfo.bstrDescription != NULL, "Exception description was NULL\n"); \ if (excepinfo.bstrDescription) \ @@ -625,9 +612,6 @@ static void test_dispid(void) /* Test basic IDispatch functions */ static void test_dispatch(void) { - static WCHAR szOpenPackage[] = { 'O','p','e','n','P','a','c','k','a','g','e',0 }; - static const WCHAR szOpenPackageException[] = {'O','p','e','n','P','a','c','k','a','g','e',',','P','a','c','k','a','g','e','P','a','t','h',',','O','p','t','i','o','n','s',0}; - static WCHAR szProductState[] = { 'P','r','o','d','u','c','t','S','t','a','t','e',0 }; HRESULT hr; DISPID dispid; OLECHAR *name; @@ -637,7 +621,7 @@ static void test_dispatch(void) DISPPARAMS dispparams = {NULL, NULL, 0, 0};
/* Test getting ID of a function name that does not exist */ - name = (WCHAR *)szMsifile; + name = (WCHAR *)L"winetest-automation.msi"; hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid); ok(hr == DISP_E_UNKNOWNNAME, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -646,7 +630,7 @@ static void test_dispatch(void) ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Test getting ID of a function name that does exist */ - name = szOpenPackage; + name = (WCHAR *)L"OpenPackage"; hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid); ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -683,10 +667,10 @@ static void test_dispatch(void) dispparams.cArgs = 1; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_BSTR; - V_BSTR(&vararg[0]) = SysAllocString(szMsifile); + V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi"); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr); - ok_exception(hr, szOpenPackageException); + ok_exception(hr, L"OpenPackage,PackagePath,Options"); VariantClear(&vararg[0]);
/* Provide the required BSTR and an empty second parameter. @@ -695,11 +679,11 @@ static void test_dispatch(void) dispparams.cArgs = 2; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_BSTR; - V_BSTR(&vararg[1]) = SysAllocString(szMsifile); + V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi"); VariantInit(&vararg[0]); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr); - ok_exception(hr, szOpenPackageException); + ok_exception(hr, L"OpenPackage,PackagePath,Options"); VariantClear(&vararg[1]);
/* Provide the required BSTR and two empty parameters. @@ -708,22 +692,22 @@ static void test_dispatch(void) dispparams.cArgs = 3; VariantInit(&vararg[2]); V_VT(&vararg[2]) = VT_BSTR; - V_BSTR(&vararg[2]) = SysAllocString(szMsifile); + V_BSTR(&vararg[2]) = SysAllocString(L"winetest-automation.msi"); VariantInit(&vararg[1]); VariantInit(&vararg[0]); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr); - ok_exception(hr, szOpenPackageException); + ok_exception(hr, L"OpenPackage,PackagePath,Options"); VariantClear(&vararg[2]);
/* Provide the required BSTR and a second parameter with the wrong type. */ dispparams.cArgs = 2; VariantInit(&vararg[1]); V_VT(&vararg[1]) = VT_BSTR; - V_BSTR(&vararg[1]) = SysAllocString(szMsifile); + V_BSTR(&vararg[1]) = SysAllocString(L"winetest-automation.msi"); VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_BSTR; - V_BSTR(&vararg[0]) = SysAllocString(szMsifile); + V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi"); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); ok(hr == DISP_E_TYPEMISMATCH, "IDispatch::Invoke returned 0x%08x\n", hr); VariantClear(&vararg[0]); @@ -738,10 +722,10 @@ static void test_dispatch(void) dispparams.cArgs = 1; VariantInit(&vararg[0]); V_VT(&vararg[0]) = VT_BSTR; - V_BSTR(&vararg[0]) = SysAllocString(szMsifile); + V_BSTR(&vararg[0]) = SysAllocString(L"winetest-automation.msi"); hr = IDispatch_Invoke(pInstaller, dispid, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL); todo_wine ok(hr == DISP_E_EXCEPTION, "IDispatch::Invoke returned 0x%08x\n", hr); - ok_exception(hr, szOpenPackageException); + ok_exception(hr, L"OpenPackage,PackagePath,Options"); VariantClear(&vararg[0]); if (hr != DISP_E_EXCEPTION) VariantClear(&varresult); @@ -831,7 +815,7 @@ static void test_dispatch(void) ok(hr == DISP_E_MEMBERNOTFOUND, "IDispatch::Invoke returned 0x%08x\n", hr);
/* Test invoking a read-only property as DISPATCH_PROPERTYPUT or as a DISPATCH_METHOD */ - name = szProductState; + name = (WCHAR *)L"ProductState"; hr = IDispatch_GetIDsOfNames(pInstaller, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid); ok(hr == S_OK, "IDispatch::GetIDsOfNames returned 0x%08x\n", hr);
@@ -1593,8 +1577,6 @@ static HRESULT SummaryInfo_PropertyCountGet(IDispatch *pSummaryInfo, int *pCount
static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *info, int num_info, BOOL readonly) { - static const WCHAR szPropertyException[] = { 'P','r','o','p','e','r','t','y',',','P','i','d',0 }; - static const WCHAR szTitle[] = { 'T','i','t','l','e',0 }; VARIANT varresult, var; SYSTEMTIME st; HRESULT hr; @@ -1647,11 +1629,11 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in /* Invalid pids */ hr = SummaryInfo_PropertyGet(pSummaryInfo, -1, &varresult, VT_EMPTY); ok(hr == DISP_E_EXCEPTION, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr); - ok_exception(hr, szPropertyException); + ok_exception(hr, L"Property,Pid");
hr = SummaryInfo_PropertyGet(pSummaryInfo, 1000, &varresult, VT_EMPTY); ok(hr == DISP_E_EXCEPTION, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr); - ok_exception(hr, szPropertyException); + ok_exception(hr, L"Property,Pid");
/* Unsupported pids */ hr = SummaryInfo_PropertyGet(pSummaryInfo, PID_DICTIONARY, &varresult, VT_EMPTY); @@ -1692,7 +1674,7 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
/* VT_BSTR */ V_VT(&var) = VT_BSTR; - V_BSTR(&var) = SysAllocString(szTitle); + V_BSTR(&var) = SysAllocString(L"Title"); hr = SummaryInfo_PropertyPut(pSummaryInfo, PID_TITLE, &var); ok(hr == S_OK, "SummaryInfo_PropertyPut failed, hresult 0x%08x\n", hr);
@@ -1736,15 +1718,10 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
static void test_Database(IDispatch *pDatabase, BOOL readonly) { - static const WCHAR szSql[] = { 'S','E','L','E','C','T',' ','`','F','e','a','t','u','r','e','`',' ','F','R','O','M',' ','`','F','e','a','t','u','r','e','`',' ','W','H','E','R','E',' ','`','F','e','a','t','u','r','e','_','P','a','r','e','n','t','`','=',''','O','n','e',''',0 }; - static const WCHAR szThree[] = { 'T','h','r','e','e',0 }; - static const WCHAR szTwo[] = { 'T','w','o',0 }; - static const WCHAR szStringDataField[] = { 'S','t','r','i','n','g','D','a','t','a',',','F','i','e','l','d',0 }; - static const WCHAR szModifyModeRecord[] = { 'M','o','d','i','f','y',',','M','o','d','e',',','R','e','c','o','r','d',0 }; IDispatch *pView = NULL, *pSummaryInfo = NULL; HRESULT hr;
- hr = Database_OpenView(pDatabase, szSql, &pView); + hr = Database_OpenView(pDatabase, L"SELECT `Feature` FROM `Feature` WHERE `Feature_Parent`='One'", &pView); ok(hr == S_OK, "Database_OpenView failed, hresult 0x%08x\n", hr); if (hr == S_OK) { @@ -1765,35 +1742,35 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly) memset(szString, 0, sizeof(szString)); hr = Record_StringDataGet(pRecord, 1, szString); ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr); - ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree); + ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
/* Record::StringDataPut with correct index */ - hr = Record_StringDataPut(pRecord, 1, szTwo); + hr = Record_StringDataPut(pRecord, 1, L"Two"); ok(hr == S_OK, "Record_StringDataPut failed, hresult 0x%08x\n", hr);
/* Record::StringDataGet */ memset(szString, 0, sizeof(szString)); hr = Record_StringDataGet(pRecord, 1, szString); ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr); - ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo); + ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
/* Record::StringDataPut with incorrect index */ hr = Record_StringDataPut(pRecord, -1, szString); ok(hr == DISP_E_EXCEPTION, "Record_StringDataPut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szStringDataField); + ok_exception(hr, L"StringData,Field");
/* View::Modify with incorrect parameters */ hr = View_Modify(pView, -5, NULL); ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModifyModeRecord); + ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, -5, pRecord); ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModifyModeRecord); + ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, MSIMODIFY_REFRESH, NULL); ok(hr == DISP_E_EXCEPTION, "View_Modify failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModifyModeRecord); + ok_exception(hr, L"Modify,Mode,Record");
hr = View_Modify(pView, MSIMODIFY_REFRESH, pRecord); ok(hr == S_OK, "View_Modify failed, hresult 0x%08x\n", hr); @@ -1802,7 +1779,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly) memset(szString, 0, sizeof(szString)); hr = Record_StringDataGet(pRecord, 1, szString); ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr); - todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szThree); + todo_wine ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Three");
IDispatch_Release(pRecord); } @@ -1817,7 +1794,7 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly) memset(szString, 0, sizeof(szString)); hr = Record_StringDataGet(pRecord, 1, szString); ok(hr == S_OK, "Record_StringDataGet failed, hresult 0x%08x\n", hr); - ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, szTwo); + ok_w2("Record_StringDataGet result was %s but expected %s\n", szString, L"Two");
IDispatch_Release(pRecord); } @@ -1849,17 +1826,6 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
static void test_Session(IDispatch *pSession) { - static const WCHAR szProductName[] = { 'P','r','o','d','u','c','t','N','a','m','e',0 }; - static const WCHAR szOne[] = { 'O','n','e',0 }; - static const WCHAR szOneStateFalse[] = { '!','O','n','e','>','0',0 }; - static const WCHAR szOneStateTrue[] = { '!','O','n','e','=','-','1',0 }; - static const WCHAR szOneActionFalse[] = { '$','O','n','e','=','-','1',0 }; - static const WCHAR szOneActionTrue[] = { '$','O','n','e','>','0',0 }; - static const WCHAR szCostInitialize[] = { 'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0 }; - static const WCHAR szEmpty[] = { 0 }; - static const WCHAR szEquals[] = { '=',0 }; - static const WCHAR szPropertyName[] = { 'P','r','o','p','e','r','t','y',',','N','a','m','e',0 }; - static const WCHAR szModeFlag[] = { 'M','o','d','e',',','F','l','a','g',0 }; WCHAR stringw[MAX_PATH]; CHAR string[MAX_PATH]; UINT len; @@ -1885,9 +1851,9 @@ static void test_Session(IDispatch *pSession)
/* Session::Property, get */ memset(stringw, 0, sizeof(stringw)); - hr = Session_PropertyGet(pSession, szProductName, stringw); + hr = Session_PropertyGet(pSession, L"ProductName", stringw); ok(hr == S_OK, "Session_PropertyGet failed, hresult 0x%08x\n", hr); - if (lstrcmpW(stringw, szMSITEST) != 0) + if (lstrcmpW(stringw, L"MSITEST") != 0) { len = WideCharToMultiByte(CP_ACP, 0, stringw, -1, string, MAX_PATH, NULL, NULL); ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError()); @@ -1895,12 +1861,12 @@ static void test_Session(IDispatch *pSession) }
/* Session::Property, put */ - hr = Session_PropertyPut(pSession, szProductName, szProductName); + hr = Session_PropertyPut(pSession, L"ProductName", L"ProductName"); ok(hr == S_OK, "Session_PropertyPut failed, hresult 0x%08x\n", hr); memset(stringw, 0, sizeof(stringw)); - hr = Session_PropertyGet(pSession, szProductName, stringw); + hr = Session_PropertyGet(pSession, L"ProductName", stringw); ok(hr == S_OK, "Session_PropertyGet failed, hresult 0x%08x\n", hr); - if (lstrcmpW(stringw, szProductName) != 0) + if (lstrcmpW(stringw, L"ProductName") != 0) { len = WideCharToMultiByte(CP_ACP, 0, stringw, -1, string, MAX_PATH, NULL, NULL); ok(len, "WideCharToMultiByteChar returned error %d\n", GetLastError()); @@ -1908,12 +1874,12 @@ static void test_Session(IDispatch *pSession) }
/* Try putting a property using empty property identifier */ - hr = Session_PropertyPut(pSession, szEmpty, szProductName); + hr = Session_PropertyPut(pSession, L"", L"ProductName"); ok(hr == DISP_E_EXCEPTION, "Session_PropertyPut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szPropertyName); + ok_exception(hr, L"Property,Name");
/* Try putting a property using illegal property identifier */ - hr = Session_PropertyPut(pSession, szEquals, szProductName); + hr = Session_PropertyPut(pSession, L"=", L"ProductName"); ok(hr == S_OK, "Session_PropertyPut failed, hresult 0x%08x\n", hr);
/* Session::Language, get */ @@ -1941,7 +1907,7 @@ static void test_Session(IDispatch *pSession)
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_TRUE); ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModeFlag); + ok_exception(hr, L"Mode,Flag");
hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTNOW, &bool); ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr); @@ -1949,11 +1915,11 @@ static void test_Session(IDispatch *pSession)
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTNOW, VARIANT_FALSE); /* set it again so we don't reboot */ ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModeFlag); + ok_exception(hr, L"Mode,Flag");
hr = Session_ModePut(pSession, MSIRUNMODE_MAINTENANCE, VARIANT_TRUE); ok(hr == DISP_E_EXCEPTION, "Session_ModePut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szModeFlag); + ok_exception(hr, L"Mode,Flag");
/* Session::Database, get */ hr = Session_Database(pSession, &pDatabase); @@ -1969,16 +1935,16 @@ static void test_Session(IDispatch *pSession) ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szEmpty, &myint); + hr = Session_EvaluateCondition(pSession, L"", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_NONE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szEquals, &myint); + hr = Session_EvaluateCondition(pSession, L"=", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_ERROR, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
/* Session::DoAction(CostInitialize) must occur before the next statements */ - hr = Session_DoAction(pSession, szCostInitialize, &myint); + hr = Session_DoAction(pSession, L"CostInitialize", &myint); ok(hr == S_OK, "Session_DoAction failed, hresult 0x%08x\n", hr); ok(myint == IDOK, "DoAction(CostInitialize) returned %d, %d expected\n", myint, IDOK);
@@ -1987,7 +1953,7 @@ static void test_Session(IDispatch *pSession) ok(hr == S_OK, "Session_SetInstallLevel failed, hresult 0x%08x\n", hr);
/* Session::FeatureCurrentState, get */ - hr = Session_FeatureCurrentState(pSession, szOne, &myint); + hr = Session_FeatureCurrentState(pSession, L"One", &myint); ok(hr == S_OK, "Session_FeatureCurrentState failed, hresult 0x%08x\n", hr); ok(myint == INSTALLSTATE_UNKNOWN, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
@@ -1999,27 +1965,27 @@ static void test_Session(IDispatch *pSession) ok(myint == 0, "Session_Message returned %x\n", myint);
/* Session::EvaluateCondition */ - hr = Session_EvaluateCondition(pSession, szOneStateFalse, &myint); + hr = Session_EvaluateCondition(pSession, L"!One>0", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szOneStateTrue, &myint); + hr = Session_EvaluateCondition(pSession, L"!One=-1", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
/* Session::FeatureRequestState, put */ - hr = Session_FeatureRequestStatePut(pSession, szOne, INSTALLSTATE_ADVERTISED); + hr = Session_FeatureRequestStatePut(pSession, L"One", INSTALLSTATE_ADVERTISED); ok(hr == S_OK, "Session_FeatureRequestStatePut failed, hresult 0x%08x\n", hr); - hr = Session_FeatureRequestStateGet(pSession, szOne, &myint); + hr = Session_FeatureRequestStateGet(pSession, L"One", &myint); ok(hr == S_OK, "Session_FeatureRequestStateGet failed, hresult 0x%08x\n", hr); ok(myint == INSTALLSTATE_ADVERTISED, "Feature request state was %d but expected %d\n", myint, INSTALLSTATE_ADVERTISED);
/* Session::EvaluateCondition */ - hr = Session_EvaluateCondition(pSession, szOneActionFalse, &myint); + hr = Session_EvaluateCondition(pSession, L"$One=-1", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_FALSE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN);
- hr = Session_EvaluateCondition(pSession, szOneActionTrue, &myint); + hr = Session_EvaluateCondition(pSession, L"$One>0", &myint); ok(hr == S_OK, "Session_EvaluateCondition failed, hresult 0x%08x\n", hr); ok(myint == MSICONDITION_TRUE, "Feature current state was %d but expected %d\n", myint, INSTALLSTATE_UNKNOWN); } @@ -2048,21 +2014,6 @@ static DWORD delete_key( HKEY hkey ) static void test_Installer_RegistryValue(void) { static const DWORD qw[2] = { 0x12345678, 0x87654321 }; - static const WCHAR szKey[] = { 'S','o','f','t','w','a','r','e','\','W','i','n','e','\','T','e','s','t',0 }; - static const WCHAR szOne[] = { 'O','n','e',0 }; - static const WCHAR szTwo[] = { 'T','w','o',0 }; - static const WCHAR szThree[] = { 'T','h','r','e','e',0 }; - static const WCHAR szREG_BINARY[] = { '(','R','E','G','_','B','I','N','A','R','Y',')',0 }; - static const WCHAR szFour[] = { 'F','o','u','r',0 }; - static const WCHAR szExpand[] = { '%','M','S','I','T','E','S','T','%',0 }; - static const WCHAR szFive[] = { 'F','i','v','e',0,'H','i',0,0 }; - static const WCHAR szFiveHi[] = { 'F','i','v','e','\n','H','i',0 }; - static const WCHAR szSix[] = { 'S','i','x',0 }; - static const WCHAR szREG_[] = { '(','R','E','G','_',']',0 }; - static const WCHAR szREG_2[] = { '(','R','E','G','_','?','?',')',0 }; - static const WCHAR szSeven[] = { 'S','e','v','e','n',0 }; - static const WCHAR szEight[] = { 'E','i','g','h','t',0 }; - static const WCHAR szBlank[] = { 0 }; VARIANT varresult; VARIANTARG vararg; WCHAR szString[MAX_PATH]; @@ -2074,7 +2025,7 @@ static void test_Installer_RegistryValue(void)
/* Delete keys */ SetLastError(0xdeadbeef); - lRet = RegOpenKeyW( HKEY_CURRENT_USER, szKey, &hkey ); + lRet = RegOpenKeyW( HKEY_CURRENT_USER, L"Software\Wine\Test", &hkey ); if (!lRet && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { win_skip("Needed W-functions are not implemented\n"); @@ -2084,129 +2035,129 @@ static void test_Installer_RegistryValue(void) delete_key( hkey );
/* Does our key exist? Shouldn't; check with all three possible value parameter types */ - hr = Installer_RegistryValueE(curr_user, szKey, &bRet); + hr = Installer_RegistryValueE(curr_user, L"Software\Wine\Test", &bRet); ok(hr == S_OK, "Installer_RegistryValueE failed, hresult 0x%08x\n", hr); ok(!bRet, "Registry key expected to not exist, but Installer_RegistryValue claims it does\n");
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, NULL, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", NULL, szString); ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, 0, szString, VT_BSTR); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", 0, szString, VT_BSTR); ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* Create key */ - ok(!RegCreateKeyW( HKEY_CURRENT_USER, szKey, &hkey ), "RegCreateKeyW failed\n"); + ok(!RegCreateKeyW( HKEY_CURRENT_USER, L"Software\Wine\Test", &hkey ), "RegCreateKeyW failed\n");
- ok(!RegSetValueExW(hkey,szOne,0,REG_SZ, (const BYTE *)szOne, sizeof(szOne)), + ok(!RegSetValueExW(hkey, L"One", 0, REG_SZ, (const BYTE *)L"One", sizeof(L"one")), "RegSetValueExW failed\n"); - ok(!RegSetValueExW(hkey,szTwo,0,REG_DWORD, (const BYTE *)qw, 4), + ok(!RegSetValueExW(hkey, L"Two", 0, REG_DWORD, (const BYTE *)qw, 4), "RegSetValueExW failed\n"); - ok(!RegSetValueExW(hkey,szThree,0,REG_BINARY, (const BYTE *)qw, 4), + ok(!RegSetValueExW(hkey, L"Three", 0, REG_BINARY, (const BYTE *)qw, 4), "RegSetValueExW failed\n"); bRet = SetEnvironmentVariableA("MSITEST", "Four"); ok(bRet, "SetEnvironmentVariableA failed %d\n", GetLastError()); - ok(!RegSetValueExW(hkey,szFour,0,REG_EXPAND_SZ, (const BYTE *)szExpand, sizeof(szExpand)), + ok(!RegSetValueExW(hkey, L"Four", 0, REG_EXPAND_SZ, (const BYTE *)L"%MSITEST%", sizeof(L"%MSITEST%")), "RegSetValueExW failed\n"); - ok(!RegSetValueExW(hkey,szFive,0,REG_MULTI_SZ, (const BYTE *)szFive, sizeof(szFive)), + ok(!RegSetValueExW(hkey, L"Five\0Hi\0", 0, REG_MULTI_SZ, (const BYTE *)L"Five\0Hi\0", sizeof(L"Five\0Hi\0")), "RegSetValueExW failed\n"); - ok(!RegSetValueExW(hkey,szSix,0,REG_QWORD, (const BYTE *)qw, 8), + ok(!RegSetValueExW(hkey, L"Six", 0, REG_QWORD, (const BYTE *)qw, 8), "RegSetValueExW failed\n"); - ok(!RegSetValueExW(hkey,szSeven,0,REG_NONE, NULL, 0), + ok(!RegSetValueExW(hkey, L"Seven", 0, REG_NONE, NULL, 0), "RegSetValueExW failed\n");
- ok(!RegSetValueExW(hkey,NULL,0,REG_SZ, (const BYTE *)szOne, sizeof(szOne)), + ok(!RegSetValueExW(hkey, NULL, 0, REG_SZ, (const BYTE *)L"One", sizeof(L"One")), "RegSetValueExW failed\n");
- ok(!RegCreateKeyW( hkey, szEight, &hkey_sub ), "RegCreateKeyW failed\n"); + ok(!RegCreateKeyW( hkey, L"Eight", &hkey_sub ), "RegCreateKeyW failed\n");
/* Does our key exist? It should, and make sure we retrieve the correct default value */ bRet = FALSE; - hr = Installer_RegistryValueE(curr_user, szKey, &bRet); + hr = Installer_RegistryValueE(curr_user, L"Software\Wine\Test", &bRet); ok(hr == S_OK, "Installer_RegistryValueE failed, hresult 0x%08x\n", hr); ok(bRet, "Registry key expected to exist, but Installer_RegistryValue claims it does not\n");
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, NULL, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", NULL, szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok_w2("Default registry value "%s" does not match expected "%s"\n", szString, szOne); + ok_w2("Default registry value "%s" does not match expected "%s"\n", szString, L"One");
/* Ask for the value of a nonexistent key */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szExpand, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"%MSITEST%", szString); ok(hr == DISP_E_BADINDEX, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr);
/* Get values of keys */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szOne, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"One", szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok_w2("Registry value "%s" does not match expected "%s"\n", szString, szOne); + ok_w2("Registry value "%s" does not match expected "%s"\n", szString, L"One");
VariantInit(&vararg); V_VT(&vararg) = VT_BSTR; - V_BSTR(&vararg) = SysAllocString(szTwo); - hr = Installer_RegistryValue(curr_user, szKey, vararg, &varresult, VT_I4); + V_BSTR(&vararg) = SysAllocString(L"Two"); + hr = Installer_RegistryValue(curr_user, L"Software\Wine\Test", vararg, &varresult, VT_I4); ok(hr == S_OK, "Installer_RegistryValue failed, hresult 0x%08x\n", hr); ok(V_I4(&varresult) == 305419896, "Registry value %d does not match expected value\n", V_I4(&varresult)); VariantClear(&varresult);
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szThree, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"Three", szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok_w2("Registry value "%s" does not match expected "%s"\n", szString, szREG_BINARY); + ok_w2("Registry value "%s" does not match expected "%s"\n", szString, L"(REG_BINARY)");
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szFour, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"Four", szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok_w2("Registry value "%s" does not match expected "%s"\n", szString, szFour); + ok_w2("Registry value "%s" does not match expected "%s"\n", szString, L"Four");
/* Vista does not NULL-terminate this case */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szFive, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"Five\0Hi\0", szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); ok_w2n("Registry value "%s" does not match expected "%s"\n", - szString, szFiveHi, lstrlenW(szFiveHi)); + szString, L"Five\nHi", lstrlenW(L"Five\nHi"));
memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueW(curr_user, szKey, szSix, szString); + hr = Installer_RegistryValueW(curr_user, L"Software\Wine\Test", L"Six", szString); ok(hr == S_OK, "Installer_RegistryValueW failed, hresult 0x%08x\n", hr); - ok(!lstrcmpW(szString, szREG_2) || broken(!lstrcmpW(szString, szREG_)), + ok(!lstrcmpW(szString, L"(REG_??)") || broken(!lstrcmpW(szString, L"(REG_]")), "Registry value does not match\n");
VariantInit(&vararg); V_VT(&vararg) = VT_BSTR; - V_BSTR(&vararg) = SysAllocString(szSeven); - hr = Installer_RegistryValue(curr_user, szKey, vararg, &varresult, VT_EMPTY); + V_BSTR(&vararg) = SysAllocString(L"Seven"); + hr = Installer_RegistryValue(curr_user, L"Software\Wine\Test", vararg, &varresult, VT_EMPTY); ok(hr == S_OK, "Installer_RegistryValue failed, hresult 0x%08x\n", hr);
/* Get string class name for the key */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, 0, szString, VT_BSTR); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", 0, szString, VT_BSTR); ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr); - ok_w2("Registry name "%s" does not match expected "%s"\n", szString, szBlank); + ok_w2("Registry name "%s" does not match expected "%s"\n", szString, L"");
/* Get name of a value by positive number (RegEnumValue like), valid index */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, 2, szString, VT_BSTR); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", 2, szString, VT_BSTR); ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr); /* RegEnumValue order seems different on wine */ - todo_wine ok_w2("Registry name "%s" does not match expected "%s"\n", szString, szTwo); + todo_wine ok_w2("Registry name "%s" does not match expected "%s"\n", szString, L"Two");
/* Get name of a value by positive number (RegEnumValue like), invalid index */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, 10, szString, VT_EMPTY); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", 10, szString, VT_EMPTY); ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* Get name of a subkey by negative number (RegEnumValue like), valid index */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, -1, szString, VT_BSTR); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", -1, szString, VT_BSTR); ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr); - ok_w2("Registry name "%s" does not match expected "%s"\n", szString, szEight); + ok_w2("Registry name "%s" does not match expected "%s"\n", szString, L"Eight");
/* Get name of a subkey by negative number (RegEnumValue like), invalid index */ memset(szString, 0, sizeof(szString)); - hr = Installer_RegistryValueI(curr_user, szKey, -10, szString, VT_EMPTY); + hr = Installer_RegistryValueI(curr_user, L"Software\Wine\Test", -10, szString, VT_EMPTY); ok(hr == S_OK, "Installer_RegistryValueI failed, hresult 0x%08x\n", hr);
/* clean up */ @@ -2262,7 +2213,7 @@ static void test_Installer_Products(BOOL bProductInstalled) ok(iValue == INSTALLSTATE_DEFAULT || iValue == INSTALLSTATE_ADVERTISED, "Installer_ProductState returned %d, expected %d or %d\n", iValue, INSTALLSTATE_DEFAULT, INSTALLSTATE_ADVERTISED);
/* Not found our product code yet? Check */ - if (!bProductFound && !lstrcmpW(szString, szProductCode)) + if (!bProductFound && !lstrcmpW(szString, L"{837450fa-a39b-4bc8-b321-08b393f784b3}")) bProductFound = TRUE;
/* IEnumVARIANT::Next */ @@ -2454,7 +2405,7 @@ static void test_Installer_InstallProduct(void) ok(hr == S_OK, "Expected UILevel property put invoke to return S_OK, got 0x%08x\n", hr);
/* Installer::InstallProduct */ - hr = Installer_InstallProduct(szMsifile, NULL); + hr = Installer_InstallProduct(L"winetest-automation.msi", NULL); if (hr == DISP_E_EXCEPTION) { skip("InstallProduct failed, insufficient rights?\n"); @@ -2464,7 +2415,7 @@ static void test_Installer_InstallProduct(void) ok(hr == S_OK, "Installer_InstallProduct failed, hresult 0x%08x\n", hr);
/* Installer::ProductState for our product code, which has been installed */ - hr = Installer_ProductState(szProductCode, &iValue); + hr = Installer_ProductState(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", &iValue); ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr); ok(iValue == INSTALLSTATE_DEFAULT, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_DEFAULT);
@@ -2472,33 +2423,33 @@ static void test_Installer_InstallProduct(void)
/* NULL attribute */ memset(szString, 0, sizeof(szString)); - hr = Installer_ProductInfo(szProductCode, NULL, szString); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", NULL, szString); ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - ok_exception(hr, szProductInfoException); + ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Nonexistent attribute */ memset(szString, 0, sizeof(szString)); - hr = Installer_ProductInfo(szProductCode, szMsifile, szString); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"winetest-automation.msi", szString); ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - ok_exception(hr, szProductInfoException); + ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Package name */ memset(szString, 0, sizeof(szString)); - hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PACKAGENAMEW, szString); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"PackageName", szString); ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, szMsifile); + todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, L"winetest-automation.msi");
/* Product name */ memset(szString, 0, sizeof(szString)); - hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PRODUCTNAMEW, szString); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"ProductName", szString); ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, szMSITEST); + todo_wine ok_w2("Installer_ProductInfo returned %s but expected %s\n", szString, L"MSITEST");
/* Installer::Products */ test_Installer_Products(TRUE);
/* Installer::RelatedProducts for our upgrade code */ - hr = Installer_RelatedProducts(szUpgradeCode, &pStringList); + hr = Installer_RelatedProducts(L"{CE067E8D-2E1A-4367-B734-4EB2BDAD6565}", &pStringList); ok(hr == S_OK, "Installer_RelatedProducts failed, hresult 0x%08x\n", hr); if (hr == S_OK) { @@ -2511,12 +2462,12 @@ static void test_Installer_InstallProduct(void) memset(szString, 0, sizeof(szString)); hr = StringList_Item(pStringList, 0, szString); ok(hr == S_OK, "StringList_Item failed (idx 0, count %d), hresult 0x%08x\n", iCount, hr); - ok_w2("StringList_Item returned %s but expected %s\n", szString, szProductCode); + ok_w2("StringList_Item returned %s but expected %s\n", szString, L"{837450fa-a39b-4bc8-b321-08b393f784b3}");
IDispatch_Release(pStringList); }
- hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_LOCALPACKAGEW, szString); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"LocalPackage", szString); ok(hr == S_OK, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); DeleteFileW( szString );
@@ -2604,8 +2555,6 @@ static void test_Installer_InstallProduct(void)
static void test_Installer(void) { - static const WCHAR szCreateRecordException[] = { 'C','r','e','a','t','e','R','e','c','o','r','d',',','C','o','u','n','t',0 }; - static const WCHAR szIntegerDataException[] = { 'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0 }; WCHAR szPath[MAX_PATH]; HRESULT hr; IDispatch *pSession = NULL, *pDatabase = NULL, *pRecord = NULL, *pStringList = NULL, *pSumInfo = NULL; @@ -2618,7 +2567,7 @@ static void test_Installer(void) /* Test for error */ hr = Installer_CreateRecord(-1, &pRecord); ok(hr == DISP_E_EXCEPTION, "Installer_CreateRecord failed, hresult 0x%08x\n", hr); - ok_exception(hr, szCreateRecordException); + ok_exception(hr, L"CreateRecord,Count");
/* Test for success */ hr = Installer_CreateRecord(1, &pRecord); @@ -2648,7 +2597,7 @@ static void test_Installer(void) /* Record::IntegerDataPut, bad index */ hr = Record_IntegerDataPut(pRecord, 10, 100); ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szIntegerDataException); + ok_exception(hr, L"IntegerData,Field");
/* Record::IntegerDataGet */ hr = Record_IntegerDataGet(pRecord, 1, &iValue); @@ -2700,7 +2649,7 @@ static void test_Installer(void) test_Installer_RegistryValue();
/* Installer::ProductState for our product code, which should not be installed */ - hr = Installer_ProductState(szProductCode, &iValue); + hr = Installer_ProductState(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", &iValue); ok(hr == S_OK, "Installer_ProductState failed, hresult 0x%08x\n", hr); ok(iValue == INSTALLSTATE_UNKNOWN, "Installer_ProductState returned %d, expected %d\n", iValue, INSTALLSTATE_UNKNOWN);
@@ -2708,21 +2657,21 @@ static void test_Installer(void)
/* Package name */ memset(szPath, 0, sizeof(szPath)); - hr = Installer_ProductInfo(szProductCode, WINE_INSTALLPROPERTY_PACKAGENAMEW, szPath); + hr = Installer_ProductInfo(L"{837450fa-a39b-4bc8-b321-08b393f784b3}", L"PackageName", szPath); ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - ok_exception(hr, szProductInfoException); + ok_exception(hr, L"ProductInfo,Product,Attribute");
/* NULL attribute and NULL product code */ memset(szPath, 0, sizeof(szPath)); hr = Installer_ProductInfo(NULL, NULL, szPath); ok(hr == DISP_E_EXCEPTION, "Installer_ProductInfo failed, hresult 0x%08x\n", hr); - ok_exception(hr, szProductInfoException); + ok_exception(hr, L"ProductInfo,Product,Attribute");
/* Installer::Products */ test_Installer_Products(FALSE);
/* Installer::RelatedProducts for our upgrade code, should not find anything */ - hr = Installer_RelatedProducts(szUpgradeCode, &pStringList); + hr = Installer_RelatedProducts(L"{CE067E8D-2E1A-4367-B734-4EB2BDAD6565}", &pStringList); ok(hr == S_OK, "Installer_RelatedProducts failed, hresult 0x%08x\n", hr); if (hr == S_OK) { @@ -2772,7 +2721,7 @@ START_TEST(automation)
hr = OleInitialize(NULL); ok (hr == S_OK, "OleInitialize returned 0x%08x\n", hr); - hr = CLSIDFromProgID(szProgId, &clsid); + hr = CLSIDFromProgID(L"WindowsInstaller.Installer", &clsid); ok (hr == S_OK, "CLSIDFromProgID returned 0x%08x\n", hr); hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk); ok(hr == S_OK, "CoCreateInstance returned 0x%08x\n", hr); diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 504f32cf96f..caf24356948 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -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); }
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 3e1c551d38f..4ffd30f0376 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -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"); } diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 2cfa810e1da..ce650b84d61 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -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); diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index eb547c98dce..5e0fa680c89 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -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);
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index bf83c116fff..f8bf431883b 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -35,8 +35,7 @@
static BOOL is_wow64; static const char msifile[] = "winetest-package.msi"; -static const WCHAR msifileW[] = - {'w','i','n','e','t','e','s','t','-','p','a','c','k','a','g','e','.','m','s','i',0}; +static const WCHAR msifileW[] = L"winetest-package.msi"; static char CURR_DIR[MAX_PATH];
static INSTALLSTATE (WINAPI *pMsiGetComponentPathExA)(LPCSTR, LPCSTR, LPCSTR, MSIINSTALLCONTEXT, LPSTR, LPDWORD); @@ -1137,8 +1136,6 @@ static void test_doaction( void )
static void test_gettargetpath_bad(void) { - static const WCHAR boo[] = {'b','o','o',0}; - static const WCHAR empty[] = {0}; char buffer[0x80]; WCHAR bufferW[0x80]; MSIHANDLE hpkg; @@ -1182,20 +1179,20 @@ static void test_gettargetpath_bad(void) r = MsiGetTargetPathW( 0, NULL, NULL, &sz ); ok( r == ERROR_INVALID_PARAMETER, "wrong return val\n");
- r = MsiGetTargetPathW( 0, boo, NULL, NULL ); + r = MsiGetTargetPathW( 0, L"boo", NULL, NULL ); ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
- r = MsiGetTargetPathW( 0, boo, NULL, NULL ); + r = MsiGetTargetPathW( 0, L"boo", NULL, NULL ); ok( r == ERROR_INVALID_HANDLE, "wrong return val\n");
- r = MsiGetTargetPathW( hpkg, boo, NULL, NULL ); + r = MsiGetTargetPathW( hpkg, L"boo", NULL, NULL ); ok( r == ERROR_DIRECTORY, "wrong return val\n");
- r = MsiGetTargetPathW( hpkg, boo, bufferW, NULL ); + r = MsiGetTargetPathW( hpkg, L"boo", bufferW, NULL ); ok( r == ERROR_DIRECTORY, "wrong return val\n");
sz = 0; - r = MsiGetTargetPathW( hpkg, empty, bufferW, &sz ); + r = MsiGetTargetPathW( hpkg, L"", bufferW, &sz ); ok( r == ERROR_DIRECTORY, "wrong return val\n");
MsiCloseHandle( hpkg ); @@ -1391,10 +1388,6 @@ static void test_settargetpath(void)
static void test_condition(void) { - static const WCHAR cond1[] = {'"','a',0x30a,'"','<','"',0xe5,'"',0}; - static const WCHAR cond2[] = {'"','a',0x30a,'"','>','"',0xe5,'"',0}; - static const WCHAR cond3[] = {'"','a',0x30a,'"','<','>','"',0xe5,'"',0}; - static const WCHAR cond4[] = {'"','a',0x30a,'"','=','"',0xe5,'"',0}; MSICONDITION r; MSIHANDLE hpkg;
@@ -2126,19 +2119,19 @@ static void test_condition(void) r = MsiEvaluateConditionA(hpkg, "A <= X"); ok( r == MSICONDITION_FALSE, "wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond1); + r = MsiEvaluateConditionW(hpkg, L""a\x30a"<"\xe5""); ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE), "wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond2); + r = MsiEvaluateConditionW(hpkg, L""a\x30a">"\xe5""); ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE), "wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond3); + r = MsiEvaluateConditionW(hpkg, L""a\x30a"<>"\xe5""); ok( r == MSICONDITION_TRUE || broken(r == MSICONDITION_FALSE), "wrong return val (%d)\n", r);
- r = MsiEvaluateConditionW(hpkg, cond4); + r = MsiEvaluateConditionW(hpkg, L""a\x30a"="\xe5""); ok( r == MSICONDITION_FALSE || broken(r == MSICONDITION_TRUE), "wrong return val (%d)\n", r);
@@ -2161,9 +2154,6 @@ static void check_prop(MSIHANDLE hpkg, const char *prop, const char *expect, int
static void test_props(void) { - static const WCHAR booW[] = {'b','o','o',0}; - static const WCHAR xyzW[] = {'x','y','z',0}; - static const WCHAR xyW[] = {'x','y',0}; MSIHANDLE hpkg, hdb; UINT r; DWORD sz; @@ -2296,36 +2286,36 @@ static void test_props(void) ok(sz == 3, "got size %u\n", sz);
sz = 0; - r = MsiGetPropertyW(hpkg, booW, NULL, &sz); + r = MsiGetPropertyW(hpkg, L"boo", NULL, &sz); ok(!r, "got %u\n", r); ok(sz == 3, "got size %u\n", sz);
sz = 0; - lstrcpyW(bufferW, booW); - r = MsiGetPropertyW(hpkg, booW, bufferW, &sz); + lstrcpyW(bufferW, L"boo"); + r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz); ok(r == ERROR_MORE_DATA, "got %u\n", r); - ok(!lstrcmpW(bufferW, booW), "got %s\n", wine_dbgstr_w(bufferW)); + ok(!lstrcmpW(bufferW, L"boo"), "got %s\n", wine_dbgstr_w(bufferW)); ok(sz == 3, "got size %u\n", sz);
sz = 1; - lstrcpyW(bufferW, booW); - r = MsiGetPropertyW(hpkg, booW, bufferW, &sz ); + lstrcpyW(bufferW, L"boo"); + r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz ); ok(r == ERROR_MORE_DATA, "got %u\n", r); ok(!bufferW[0], "got %s\n", wine_dbgstr_w(bufferW)); ok(sz == 3, "got size %u\n", sz);
sz = 3; - lstrcpyW(bufferW, booW); - r = MsiGetPropertyW(hpkg, booW, bufferW, &sz ); + lstrcpyW(bufferW, L"boo"); + r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz ); ok(r == ERROR_MORE_DATA, "got %u\n", r); - ok(!lstrcmpW(bufferW, xyW), "got %s\n", wine_dbgstr_w(bufferW)); + ok(!lstrcmpW(bufferW, L"xy"), "got %s\n", wine_dbgstr_w(bufferW)); ok(sz == 3, "got size %u\n", sz);
sz = 4; - lstrcpyW(bufferW, booW); - r = MsiGetPropertyW(hpkg, booW, bufferW, &sz ); + lstrcpyW(bufferW, L"boo"); + r = MsiGetPropertyW(hpkg, L"boo", bufferW, &sz ); ok(!r, "got %u\n", r); - ok(!lstrcmpW(bufferW, xyzW), "got %s\n", wine_dbgstr_w(bufferW)); + ok(!lstrcmpW(bufferW, L"xyz"), "got %s\n", wine_dbgstr_w(bufferW)); ok(sz == 3, "got size %u\n", sz);
/* properties are case-sensitive */ @@ -3074,12 +3064,9 @@ static void test_states(void) static const char msifile2[] = "winetest2-package.msi"; static const char msifile3[] = "winetest3-package.msi"; static const char msifile4[] = "winetest4-package.msi"; - static const WCHAR msifile2W[] = - {'w','i','n','e','t','e','s','t','2','-','p','a','c','k','a','g','e','.','m','s','i',0}; - static const WCHAR msifile3W[] = - {'w','i','n','e','t','e','s','t','3','-','p','a','c','k','a','g','e','.','m','s','i',0}; - static const WCHAR msifile4W[] = - {'w','i','n','e','t','e','s','t','4','-','p','a','c','k','a','g','e','.','m','s','i',0}; + static const WCHAR msifile2W[] = L"winetest2-package.msi"; + static const WCHAR msifile3W[] = L"winetest3-package.msi"; + static const WCHAR msifile4W[] = L"winetest4-package.msi"; char msi_cache_file[MAX_PATH]; DWORD cache_file_name_len; INSTALLSTATE state; @@ -4011,7 +3998,7 @@ static void test_removefiles(void) ok( action == INSTALLSTATE_UNKNOWN, "expected INSTALLSTATE_UNKNOWN, got %d\n", action );
ok(DeleteFileA("hydrogen.txt"), "Expected hydrogen.txt to exist\n"); - ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n"); + ok(DeleteFileA("lithium.txt"), "Expected lithium.txt to exist\n"); ok(DeleteFileA("beryllium.txt"), "Expected beryllium.txt to exist\n"); ok(DeleteFileA("carbon.txt"), "Expected carbon.txt to exist\n"); ok(DeleteFileA("helium.txt"), "Expected helium.txt to exist\n"); @@ -7959,11 +7946,6 @@ static void test_emptypackage(void)
static void test_MsiGetProductProperty(void) { - static const WCHAR prodcode_propW[] = {'P','r','o','d','u','c','t','C','o','d','e',0}; - static const WCHAR nonexistentW[] = {'I','D','o','n','t','E','x','i','s','t',0}; - static const WCHAR newpropW[] = {'N','e','w','P','r','o','p','e','r','t','y',0}; - static const WCHAR appleW[] = {'a','p','p','l','e',0}; - static const WCHAR emptyW[] = {0}; WCHAR valW[MAX_PATH]; MSIHANDLE hprod, hdb; CHAR val[MAX_PATH]; @@ -8069,11 +8051,11 @@ static void test_MsiGetProductProperty(void) ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(0xdeadbeef, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(0xdeadbeef, L"ProductCode", valW, &size); ok(r == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", r); - ok(!lstrcmpW(valW, appleW), + ok(!lstrcmpW(valW, L"apple"), "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
@@ -8088,11 +8070,11 @@ static void test_MsiGetProductProperty(void) ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
size = MAX_PATH; - lstrcpyW(valW, appleW); + lstrcpyW(valW, L"apple"); r = MsiGetProductPropertyW(hprod, NULL, valW, &size); ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - ok(!lstrcmpW(valW, appleW), + ok(!lstrcmpW(valW, L"apple"), "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); ok(size == MAX_PATH, "Expected size to be unchanged, got %d\n", size);
@@ -8105,8 +8087,8 @@ static void test_MsiGetProductProperty(void) ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, emptyW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(*valW == 0, "Expected "", got %s\n", wine_dbgstr_w(valW)); ok(size == 0, "Expected 0, got %d\n", size); @@ -8122,8 +8104,8 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(valW, prodcodeW), "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); @@ -8138,7 +8120,7 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH; - r = MsiGetProductPropertyW(hprod, prodcode_propW, NULL, &size); + r = MsiGetProductPropertyW(hprod, L"ProductCode", NULL, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(size == lstrlenW(prodcodeW), "Expected %d, got %d\n", lstrlenW(prodcodeW), size); @@ -8153,11 +8135,11 @@ static void test_MsiGetProductProperty(void) ok(size == lstrlenA(prodcode), "Expected %d, got %d\n", lstrlenA(prodcode), size);
- lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, NULL); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, NULL); ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r); - ok(!lstrcmpW(valW, appleW), + ok(!lstrcmpW(valW, L"apple"), "Expected val to be unchanged, got %s\n", wine_dbgstr_w(valW)); ok(size == lstrlenW(prodcodeW), "Expected %d, got %d\n", lstrlenW(prodcodeW), size); @@ -8173,8 +8155,8 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = 4; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size); ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); ok(!memcmp(valW, prodcodeW, 3 * sizeof(WCHAR)), "Expected first 3 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); @@ -8192,8 +8174,8 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = lstrlenW(prodcodeW); - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size); ok(r == ERROR_MORE_DATA, "Expected ERROR_MORE_DATA, got %d\n", r); ok(!memcmp(valW, prodcodeW, lstrlenW(prodcodeW) - 1), "Expected first 37 chars of %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); @@ -8211,8 +8193,8 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = lstrlenW(prodcodeW) + 1; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(valW, prodcodeW), "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); @@ -8228,10 +8210,10 @@ static void test_MsiGetProductProperty(void) ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, nonexistentW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"IDontExist", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpW(valW, emptyW), "Expected "", got %s\n", wine_dbgstr_w(valW)); + ok(!lstrcmpW(valW, L""), "Expected "", got %s\n", wine_dbgstr_w(valW)); ok(size == 0, "Expected 0, got %d\n", size);
r = MsiSetPropertyA(hprod, "NewProperty", "value"); @@ -8246,10 +8228,10 @@ static void test_MsiGetProductProperty(void) ok(size == 0, "Expected 0, got %d\n", size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, newpropW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"NewProperty", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpW(valW, emptyW), "Expected "", got %s\n", wine_dbgstr_w(valW)); + ok(!lstrcmpW(valW, L""), "Expected "", got %s\n", wine_dbgstr_w(valW)); ok(size == 0, "Expected 0, got %d\n", size);
r = MsiSetPropertyA(hprod, "ProductCode", "value"); @@ -8266,8 +8248,8 @@ static void test_MsiGetProductProperty(void) "Expected %d, got %d\n", lstrlenA(prodcode), size);
size = MAX_PATH; - lstrcpyW(valW, appleW); - r = MsiGetProductPropertyW(hprod, prodcode_propW, valW, &size); + lstrcpyW(valW, L"apple"); + r = MsiGetProductPropertyW(hprod, L"ProductCode", valW, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpW(valW, prodcodeW), "Expected %s, got %s\n", wine_dbgstr_w(prodcodeW), wine_dbgstr_w(valW)); diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c index 87f64d6c835..65b3a5f1d48 100644 --- a/dlls/msi/tests/patch.c +++ b/dlls/msi/tests/patch.c @@ -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`"; diff --git a/dlls/msi/tests/record.c b/dlls/msi/tests/record.c index d0ad15b8fef..8e4c2df4294 100644 --- a/dlls/msi/tests/record.c +++ b/dlls/msi/tests/record.c @@ -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;
diff --git a/dlls/msi/tests/suminfo.c b/dlls/msi/tests/suminfo.c index 8c2e292ab8f..1ef18310206 100644 --- a/dlls/msi/tests/suminfo.c +++ b/dlls/msi/tests/suminfo.c @@ -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) {