Michael Stefaniuc : ieframe/tests: Get rid of a2bstr() in ie.c.

Alexandre Julliard julliard at winehq.org
Tue Feb 11 15:44:55 CST 2020


Module: wine
Branch: master
Commit: 5de16dcee595b1c3a8096f912c0be47c7b3c01b8
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5de16dcee595b1c3a8096f912c0be47c7b3c01b8

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Sun Feb  9 16:51:44 2020 +0200

ieframe/tests: Get rid of a2bstr() in ie.c.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ieframe/tests/ie.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/dlls/ieframe/tests/ie.c b/dlls/ieframe/tests/ie.c
index 4d51f70329..b2c39e7baa 100644
--- a/dlls/ieframe/tests/ie.c
+++ b/dlls/ieframe/tests/ie.c
@@ -59,18 +59,6 @@ DEFINE_EXPECT(Invoke_NAVIGATECOMPLETE2);
 
 static BOOL navigate_complete;
 
-static BSTR a2bstr(const char *str)
-{
-    BSTR ret;
-    int len;
-
-    len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
-    ret = SysAllocStringLen(NULL, len);
-    MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
-
-    return ret;
-}
-
 static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
 {
     if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IDispatch, riid)) {
@@ -223,7 +211,7 @@ static void test_window(IWebBrowser2 *wb)
     ok(!strcmp(buf, "IEFrame"), "Unexpected class name %s\n", buf);
 }
 
-static void test_navigate(IWebBrowser2 *wb, const char *url)
+static void test_navigate(IWebBrowser2 *wb, const WCHAR *url)
 {
     VARIANT urlv, emptyv;
     MSG msg;
@@ -232,7 +220,7 @@ static void test_navigate(IWebBrowser2 *wb, const char *url)
     SET_EXPECT(Invoke_NAVIGATECOMPLETE2);
 
     V_VT(&urlv) = VT_BSTR;
-    V_BSTR(&urlv) = a2bstr(url);
+    V_BSTR(&urlv) = SysAllocString(url);
     V_VT(&emptyv) = VT_EMPTY;
     hres = IWebBrowser2_Navigate2(wb, &urlv, &emptyv, &emptyv, &emptyv, &emptyv);
     ok(hres == S_OK, "Navigate2 failed: %08x\n", hres);
@@ -284,7 +272,7 @@ static void test_InternetExplorer(void)
     test_visible(wb);
     test_html_window(wb);
     test_window(wb);
-    test_navigate(wb, "http://test.winehq.org/tests/hello.html");
+    test_navigate(wb, L"http://test.winehq.org/tests/hello.html");
 
     advise_cp(unk, FALSE);
 




More information about the wine-cvs mailing list