[PATCH] ieframe/tests: Use wide-char string literals.
Michael Stefaniuc
mstefani at winehq.org
Sun Dec 6 09:02:18 CST 2020
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/ieframe/tests/intshcut.c | 12 ++++--------
dlls/ieframe/tests/webbrowser.c | 16 +++++-----------
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c
index 803e7ec60e9..d2135d0ebb3 100644
--- a/dlls/ieframe/tests/intshcut.c
+++ b/dlls/ieframe/tests/intshcut.c
@@ -171,9 +171,7 @@ static void test_ReadAndWriteProperties(void)
IUniformResourceLocatorA *urlA;
IUniformResourceLocatorA *urlAFromFile;
WCHAR fileNameW[MAX_PATH];
-
- static const WCHAR shortcutW[] = {'t','e','s','t','s','h','o','r','t','c','u','t','.','u','r','l',0};
- WCHAR iconPath[] = {'f','i','l','e',':','/','/','/','C',':','/','a','r','b','i','t','r','a','r','y','/','i','c','o','n','/','p','a','t','h',0};
+ static WCHAR iconPath[] = L"file:///C:/arbitrary/icon/path";
char testurl[] = "http://some/bogus/url.html";
ps[0].ulKind = PRSPEC_PROPID;
@@ -183,7 +181,7 @@ static void test_ReadAndWriteProperties(void)
/* Make sure we have a valid temporary directory */
GetTempPathW(MAX_PATH, fileNameW);
- lstrcatW(fileNameW, shortcutW);
+ lstrcatW(fileNameW, L"testshortcut.url");
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hr);
@@ -208,7 +206,7 @@ static void test_ReadAndWriteProperties(void)
IPersistFile_Release(pf);
pv[0].vt = VT_LPWSTR;
- U(pv[0]).pwszVal = (void *) iconPath;
+ U(pv[0]).pwszVal = iconPath;
pv[1].vt = VT_I4;
U(pv[1]).lVal = iconIndex;
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPropertySetStorage, (void **) &pPropSetStg);
@@ -326,10 +324,8 @@ static void test_Load(void)
HANDLE file;
HRESULT hres;
- static const WCHAR test_urlW[] = {'t','e','s','t','.','u','r','l',0};
-
GetTempPathW(MAX_PATH, file_path);
- lstrcatW(file_path, test_urlW);
+ lstrcatW(file_path, L"test.url");
for(test = load_tests; test < load_tests + ARRAY_SIZE(load_tests); test++) {
IPropertySetStorage *propsetstorage;
diff --git a/dlls/ieframe/tests/webbrowser.c b/dlls/ieframe/tests/webbrowser.c
index 9c2c393aafe..52d1f707357 100644
--- a/dlls/ieframe/tests/webbrowser.c
+++ b/dlls/ieframe/tests/webbrowser.c
@@ -160,8 +160,6 @@ DEFINE_EXPECT(GetExternal);
DEFINE_EXPECT(outer_QI_test);
DEFINE_EXPECT(Advise_OnClose);
-static const WCHAR wszItem[] = {'i','t','e','m',0};
-
static VARIANT_BOOL exvb;
static IWebBrowser2 *wb;
@@ -1268,7 +1266,7 @@ static HRESULT WINAPI InPlaceUIWindow_SetActiveObject(IOleInPlaceFrame *iface,
CHECK_EXPECT(UIWindow_SetActiveObject);
if(!test_close && !test_hide) {
ok(pActiveObject != NULL, "pActiveObject = NULL\n");
- ok(!lstrcmpW(pszObjName, wszItem), "unexpected pszObjName\n");
+ ok(!lstrcmpW(pszObjName, L"item"), "unexpected pszObjName\n");
} else {
ok(!pActiveObject, "pActiveObject != NULL\n");
ok(!pszObjName, "pszObjName != NULL\n");
@@ -1282,7 +1280,7 @@ static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
CHECK_EXPECT(Frame_SetActiveObject);
if(!test_close && !test_hide) {
ok(pActiveObject != NULL, "pActiveObject = NULL\n");
- ok(!lstrcmpW(pszObjName, wszItem), "unexpected pszObjName\n");
+ ok(!lstrcmpW(pszObjName, L"item"), "unexpected pszObjName\n");
} else {
ok(!pActiveObject, "pActiveObject != NULL\n");
ok(!pszObjName, "pszObjName != NULL\n");
@@ -1817,19 +1815,17 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
static HWND create_container_window(void)
{
- static const WCHAR wszWebBrowserContainer[] =
- {'W','e','b','B','r','o','w','s','e','r','C','o','n','t','a','i','n','e','r',0};
static WNDCLASSEXW wndclass = {
sizeof(WNDCLASSEXW),
0,
wnd_proc,
0, 0, NULL, NULL, NULL, NULL, NULL,
- wszWebBrowserContainer,
+ L"WebBrowserContainer",
NULL
};
RegisterClassExW(&wndclass);
- return CreateWindowW(wszWebBrowserContainer, wszWebBrowserContainer,
+ return CreateWindowW(L"WebBrowserContainer", L"WebBrowserContainer",
WS_OVERLAPPEDWINDOW, 10, 10, 600, 600, NULL, NULL, NULL, NULL);
}
@@ -1942,9 +1938,7 @@ static void test_SetHostNames(IOleObject *oleobj)
{
HRESULT hres;
- static const WCHAR test_appW[] = {'t','e','s','t',' ','a','p','p',0};
-
- hres = IOleObject_SetHostNames(oleobj, test_appW, (void*)0xdeadbeef);
+ hres = IOleObject_SetHostNames(oleobj, L"test app", (void*)0xdeadbeef);
ok(hres == S_OK, "SetHostNames failed: %08x\n", hres);
}
--
2.26.2
More information about the wine-devel
mailing list