Module: wine Branch: master Commit: 1d36b93f7e484d8e6bc15d6acdbad12af5ecd4e2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1d36b93f7e484d8e6bc15d6acd...
Author: Frédéric Delanoy frederic.delanoy@gmail.com Date: Thu Dec 26 22:49:27 2013 +0100
msi/tests: Constify some character strings.
---
dlls/msi/tests/action.c | 2 +- dlls/msi/tests/automation.c | 40 ++++++++++++++++++++-------------------- dlls/msi/tests/install.c | 6 +++--- dlls/msi/tests/msi.c | 2 +- dlls/msi/tests/package.c | 6 +++--- dlls/msi/tests/patch.c | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/dlls/msi/tests/action.c b/dlls/msi/tests/action.c index 8386038..ee750b0 100644 --- a/dlls/msi/tests/action.c +++ b/dlls/msi/tests/action.c @@ -5547,7 +5547,7 @@ error:
static void test_publish_components(void) { - static char keypath[] = + static const char keypath[] = "Software\Microsoft\Installer\Components\0CBCFA296AC907244845745CEEB2F8AA";
UINT r; diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 550afc2..c7cc411 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -452,7 +452,7 @@ static CHAR string1[MAX_PATH], string2[MAX_PATH]; ok(0, format, extra, string1, aString); \
/* exception checker */ -static WCHAR szSource[] = {'M','s','i',' ','A','P','I',' ','E','r','r','o','r',0}; +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) \ @@ -595,7 +595,7 @@ static void test_dispid(void) static void test_dispatch(void) { static WCHAR szOpenPackage[] = { 'O','p','e','n','P','a','c','k','a','g','e',0 }; - static 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 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; @@ -1688,11 +1688,11 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
static void test_Database(IDispatch *pDatabase, BOOL readonly) { - static 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 WCHAR szThree[] = { 'T','h','r','e','e',0 }; - static WCHAR szTwo[] = { 'T','w','o',0 }; - static WCHAR szStringDataField[] = { 'S','t','r','i','n','g','D','a','t','a',',','F','i','e','l','d',0 }; - static WCHAR szModifyModeRecord[] = { 'M','o','d','i','f','y',',','M','o','d','e',',','R','e','c','o','r','d',0 }; + 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;
@@ -1801,17 +1801,17 @@ static void test_Database(IDispatch *pDatabase, BOOL readonly)
static void test_Session(IDispatch *pSession) { - static WCHAR szProductName[] = { 'P','r','o','d','u','c','t','N','a','m','e',0 }; - static WCHAR szOne[] = { 'O','n','e',0 }; - static WCHAR szOneStateFalse[] = { '!','O','n','e','>','0',0 }; - static WCHAR szOneStateTrue[] = { '!','O','n','e','=','-','1',0 }; - static WCHAR szOneActionFalse[] = { '$','O','n','e','=','-','1',0 }; - static WCHAR szOneActionTrue[] = { '$','O','n','e','>','0',0 }; - static WCHAR szCostInitialize[] = { 'C','o','s','t','I','n','i','t','i','a','l','i','z','e',0 }; - static WCHAR szEmpty[] = { 0 }; - static WCHAR szEquals[] = { '=',0 }; - static WCHAR szPropertyName[] = { 'P','r','o','p','e','r','t','y',',','N','a','m','e',0 }; - static WCHAR szModeFlag[] = { 'M','o','d','e',',','F','l','a','g',0 }; + 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; @@ -2547,8 +2547,8 @@ static void test_Installer_InstallProduct(void)
static void test_Installer(void) { - static WCHAR szCreateRecordException[] = { 'C','r','e','a','t','e','R','e','c','o','r','d',',','C','o','u','n','t',0 }; - static WCHAR szIntegerDataException[] = { 'I','n','t','e','g','e','r','D','a','t','a',',','F','i','e','l','d',0 }; + 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; diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 24f87eb..45c6a5f 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -4806,7 +4806,7 @@ error:
static void test_installed_prop(void) { - static char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}"; + static const char prodcode[] = "{7df88a48-996f-4ec8-a022-bf956f9b2cbb}"; UINT r;
if (is_process_limited()) @@ -4959,8 +4959,8 @@ error: DeleteFileA(msifile); }
-static char session_manager[] = "System\CurrentControlSet\Control\Session Manager"; -static char rename_ops[] = "PendingFileRenameOperations"; +static const char session_manager[] = "System\CurrentControlSet\Control\Session Manager"; +static const char rename_ops[] = "PendingFileRenameOperations";
static void process_pending_renames(HKEY hkey) { diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 95fe97f..b65d131 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -13752,7 +13752,7 @@ static void test_MsiSetExternalUI(void)
static void test_lastusedsource(void) { - static char prodcode[] = "{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}"; + static const char prodcode[] = "{38847338-1BBC-4104-81AC-2FAAC7ECDDCD}"; char value[MAX_PATH], path[MAX_PATH]; DWORD size; UINT r; diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index c527118..359c745 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -2647,9 +2647,9 @@ static void test_component_states( UINT line, MSIHANDLE package, const char *com
static void test_states(void) { - static char msifile2[] = "winetest2-package.msi"; - static char msifile3[] = "winetest3-package.msi"; - static char msifile4[] = "winetest4-package.msi"; + 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[] = diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c index 3168c85..62a4b86 100644 --- a/dlls/msi/tests/patch.c +++ b/dlls/msi/tests/patch.c @@ -950,7 +950,7 @@ static void test_MsiOpenDatabase( void )
static UINT find_entry( MSIHANDLE hdb, const char *table, const char *entry ) { - static char fmt[] = "SELECT * FROM `%s` WHERE `Name` = '%s'"; + static const char fmt[] = "SELECT * FROM `%s` WHERE `Name` = '%s'"; char query[0x100]; UINT r; MSIHANDLE hview, hrec;