[BROWSEUI_WINETEST]
authorAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 May 2012 16:00:16 +0000 (16:00 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Thu, 17 May 2012 16:00:16 +0000 (16:00 +0000)
* Sync to Wine 1.5.4.

svn path=/trunk/; revision=56600

rostests/winetests/browseui/CMakeLists.txt
rostests/winetests/browseui/autocomplete.c
rostests/winetests/browseui/progressdlg.c [new file with mode: 0644]
rostests/winetests/browseui/testlist.c

index 9dfafd0..326999f 100644 (file)
@@ -3,7 +3,10 @@ add_definitions(
     -D__ROS_LONG64__
     -D_DLL -D__USE_CRTIMP)
 
     -D__ROS_LONG64__
     -D_DLL -D__USE_CRTIMP)
 
-add_executable(browseui_winetest autocomplete.c testlist.c)
+add_executable(browseui_winetest
+    autocomplete.c
+    progressdlg.c
+    testlist.c)
 target_link_libraries(browseui_winetest wine uuid)
 set_module_type(browseui_winetest win32cui)
 add_importlibs(browseui_winetest user32 ole32 msvcrt kernel32 ntdll)
 target_link_libraries(browseui_winetest wine uuid)
 set_module_type(browseui_winetest win32cui)
 add_importlibs(browseui_winetest user32 ole32 msvcrt kernel32 ntdll)
index e56c599..120a5b0 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <assert.h>
 #include <stdarg.h>
 
 #include <initguid.h>
 #include <windows.h>
 #include <shlobj.h>
 #include <stdarg.h>
 
 #include <initguid.h>
 #include <windows.h>
 #include <shlobj.h>
+#include <shldisp.h>
 #include <shlwapi.h>
 #include <shlguid.h>
 
 #include <shlwapi.h>
 #include <shlguid.h>
 
@@ -127,10 +127,8 @@ static HRESULT STDMETHODCALLTYPE TestACL_QueryInterface(IEnumString *iface, REFI
         return S_OK;
     }
 
         return S_OK;
     }
 
-#if 0   /* IID_IEnumACString not defined yet in wine */
     if (!IsEqualGUID(iid, &IID_IEnumACString))
         trace("unknown interface queried\n");
     if (!IsEqualGUID(iid, &IID_IEnumACString))
         trace("unknown interface queried\n");
-#endif
     return E_NOINTERFACE;
 }
 
     return E_NOINTERFACE;
 }
 
@@ -239,6 +237,8 @@ static void test_ACLMulti(void)
     const char *strings2[] = {"a", "b", "d"};
     WCHAR exp[] = {'A','B','C',0};
     IEnumString *obj;
     const char *strings2[] = {"a", "b", "d"};
     WCHAR exp[] = {'A','B','C',0};
     IEnumString *obj;
+    IEnumACString *unk;
+    HRESULT hr;
     TestACL *acl1, *acl2;
     IACList *acl;
     IObjMgr *mgr;
     TestACL *acl1, *acl2;
     IACList *acl;
     IObjMgr *mgr;
@@ -252,11 +252,16 @@ static void test_ACLMulti(void)
     ok(obj->lpVtbl->QueryInterface(obj, &IID_IACList2, &tmp) == E_NOINTERFACE,
         "Unexpected interface IACList2 in ACLMulti\n");
     stop_on_error(obj->lpVtbl->QueryInterface(obj, &IID_IObjMgr, (LPVOID *)&mgr));
     ok(obj->lpVtbl->QueryInterface(obj, &IID_IACList2, &tmp) == E_NOINTERFACE,
         "Unexpected interface IACList2 in ACLMulti\n");
     stop_on_error(obj->lpVtbl->QueryInterface(obj, &IID_IObjMgr, (LPVOID *)&mgr));
-#if 0        /* IID_IEnumACString not defined yet in wine */
-    ole_ok(obj->lpVtbl->QueryInterface(obj, &IID_IEnumACString, &unk));
-    if (unk != NULL)
-        unk->lpVtbl->Release(unk);
-#endif
+
+    hr = obj->lpVtbl->QueryInterface(obj, &IID_IEnumACString, (LPVOID*)&unk);
+    if (hr == E_NOINTERFACE)
+        todo_wine win_skip("IEnumACString is not supported, skipping tests\n");
+    else
+    {
+        ok(hr == S_OK, "QueryInterface(IID_IEnumACString) failed: %x\n", hr);
+        if (unk != NULL)
+            unk->lpVtbl->Release(unk);
+    }
 
     ok(obj->lpVtbl->Next(obj, 1, (LPOLESTR *)&tmp, &i) == S_FALSE, "Unexpected return from Next\n");
     ok(i == 0, "Unexpected fetched value %d\n", i);
 
     ok(obj->lpVtbl->Next(obj, 1, (LPOLESTR *)&tmp, &i) == S_FALSE, "Unexpected return from Next\n");
     ok(i == 0, "Unexpected fetched value %d\n", i);
diff --git a/rostests/winetests/browseui/progressdlg.c b/rostests/winetests/browseui/progressdlg.c
new file mode 100644 (file)
index 0000000..e4d0e2f
--- /dev/null
@@ -0,0 +1,72 @@
+/* Unit tests for progressdialog object
+ *
+ * Copyright 2012 Detlef Riekenberg
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#define COBJMACROS
+
+#include <stdarg.h>
+#include <shlobj.h>
+
+#include "wine/test.h"
+
+
+static void test_IProgressDialog_QueryInterface(void)
+{
+    IProgressDialog *dlg;
+    IProgressDialog *dlg2;
+    IOleWindow *olewindow;
+    IUnknown *unk;
+    HRESULT hr;
+
+    hr = CoCreateInstance(&CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, &IID_IProgressDialog, (void*)&dlg);
+    if (FAILED(hr)) {
+        win_skip("CoCreateInstance for IProgressDialog returned 0x%x\n", hr);
+        return;
+    }
+
+    hr = IUnknown_QueryInterface(dlg, &IID_IUnknown, NULL);
+    ok(hr == E_POINTER, "got 0x%x (expected E_POINTER)\n", hr);
+
+    hr = IUnknown_QueryInterface(dlg, &IID_IUnknown, (void**)&unk);
+    ok(hr == S_OK, "QueryInterface (IUnknown) returned 0x%x\n", hr);
+    if (SUCCEEDED(hr)) {
+        IUnknown_Release(unk);
+    }
+
+    hr = IUnknown_QueryInterface(dlg, &IID_IOleWindow, (void**)&olewindow);
+    ok(hr == S_OK, "QueryInterface (IOleWindow) returned 0x%x\n", hr);
+    if (SUCCEEDED(hr)) {
+        hr = IUnknown_QueryInterface(olewindow, &IID_IProgressDialog, (void**)&dlg2);
+        ok(hr == S_OK, "QueryInterface (IProgressDialog) returned 0x%x\n", hr);
+        if (SUCCEEDED(hr)) {
+            IProgressDialog_Release(dlg2);
+        }
+        IOleWindow_Release(olewindow);
+    }
+    IProgressDialog_Release(dlg);
+}
+
+
+START_TEST(progressdlg)
+{
+    CoInitialize(NULL);
+
+    test_IProgressDialog_QueryInterface();
+
+    CoUninitialize();
+}
index 89bfdeb..db35bac 100644 (file)
@@ -7,9 +7,11 @@
 #include "wine/test.h"
 
 extern void func_autocomplete(void);
 #include "wine/test.h"
 
 extern void func_autocomplete(void);
+extern void func_progressdlg(void);
 
 const struct test winetest_testlist[] =
 {
     { "autocomplete", func_autocomplete },
 
 const struct test winetest_testlist[] =
 {
     { "autocomplete", func_autocomplete },
+    { "progressdlg", func_progressdlg },
     { 0, 0 }
 };
     { 0, 0 }
 };