mshtml/tests: Fix test failures on Win9x/WinME.
authorPaul Vriens <Paul.Vriens.Wine@gmail.com>
Thu, 10 Sep 2009 06:00:14 +0000 (08:00 +0200)
committerAlexandre Julliard <julliard@winehq.org>
Thu, 10 Sep 2009 08:50:54 +0000 (10:50 +0200)
dlls/mshtml/tests/events.c

index f78e56b4991ae233c76ba31abda0aeb14ccb06ce..d0ddadb44da3f7ff3d6300057e117123b684b144 100644 (file)
@@ -105,9 +105,9 @@ static const char *debugstr_guid(REFIID riid)
 
 static int strcmp_wa(LPCWSTR strw, const char *stra)
 {
-    WCHAR buf[512];
-    MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, sizeof(buf)/sizeof(WCHAR));
-    return lstrcmpW(strw, buf);
+    CHAR buf[512];
+    WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
+    return lstrcmpA(stra, buf);
 }
 
 static BSTR a2bstr(const char *str)
@@ -1357,12 +1357,10 @@ static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, D
         BSTR state;
         HRESULT hres;
 
-        static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
-
         hres = IHTMLDocument2_get_readyState(notif_doc, &state);
         ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
 
-        if(!lstrcmpW(state, completeW))
+        if(!strcmp_wa(state, "complete"))
             doc_complete = TRUE;
 
         SysFreeString(state);
@@ -1524,19 +1522,18 @@ static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
 
 static HWND create_container_window(void)
 {
-    static const WCHAR wszHTMLDocumentTest[] =
-        {'H','T','M','L','D','o','c','u','m','e','n','t','T','e','s','t',0};
-    static WNDCLASSEXW wndclass = {
-        sizeof(WNDCLASSEXW),
+    static const CHAR szHTMLDocumentTest[] = "HTMLDocumentTest";
+    static WNDCLASSEXA wndclass = {
+        sizeof(WNDCLASSEXA),
         0,
         wnd_proc,
         0, 0, NULL, NULL, NULL, NULL, NULL,
-        wszHTMLDocumentTest,
+        szHTMLDocumentTest,
         NULL
     };
 
-    RegisterClassExW(&wndclass);
-    return CreateWindowW(wszHTMLDocumentTest, wszHTMLDocumentTest,
+    RegisterClassExA(&wndclass);
+    return CreateWindowA(szHTMLDocumentTest, szHTMLDocumentTest,
             WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT,
             300, 300, NULL, NULL, NULL, NULL);
 }