Jacek Caban : mshtml/tests: Get rid of strstr_wa.

Alexandre Julliard julliard at winehq.org
Tue Jan 28 15:35:26 CST 2020


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jan 28 16:41:37 2020 +0100

mshtml/tests: Get rid of strstr_wa.

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

---

 dlls/mshtml/tests/style.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index 37a1426270..ac898dffca 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -81,22 +81,6 @@ static BSTR a2bstr(const char *str)
     return ret;
 }
 
-static const WCHAR *strstr_wa(const WCHAR *str, const char *suba)
-{
-    BSTR sub;
-    const WCHAR *ret = NULL;
-    sub = a2bstr(suba);
-    while (*str)
-    {
-        const WCHAR *p1 = str, *p2 = sub;
-        while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
-        if (!*p2) {ret = str; break;}
-        str++;
-    }
-    SysFreeString(sub);
-    return ret;
-}
-
 #define test_var_bstr(a,b) _test_var_bstr(__LINE__,a,b)
 static void _test_var_bstr(unsigned line, const VARIANT *v, const char *expect)
 {
@@ -2920,14 +2904,13 @@ static void test_body_style(IHTMLStyle *style)
     if (hres != E_INVALIDARG) {
         hres = IHTMLStyle_get_listStyle(style, &str);
         ok(hres == S_OK, "get_listStyle failed: %08x\n", hres);
-        ok(strstr_wa(str, "decimal-leading-zero") &&
-           strstr_wa(str, "inside") != NULL,
+        ok(wcsstr(str, L"decimal-leading-zero") && wcsstr(str, L"inside"),
             "listStyle = %s\n", wine_dbgstr_w(str));
         if(compat_mode < COMPAT_IE9)
-            ok(strstr_wa(str, "none") != NULL, "listStyle = %s\n", wine_dbgstr_w(str));
+            ok(wcsstr(str, L"none") != NULL, "listStyle = %s\n", wine_dbgstr_w(str));
         else
             todo_wine
-            ok(!strstr_wa(str, "none"), "listStyle = %s\n", wine_dbgstr_w(str));
+            ok(!wcsstr(str, L"none"), "listStyle = %s\n", wine_dbgstr_w(str));
 
         SysFreeString(str);
     }  else {




More information about the wine-cvs mailing list