[PATCH 2/3] browseui/tests: Add tests for IProgressDialog

Detlef Riekenberg wine.dev at web.de
Sun Apr 15 15:08:37 CDT 2012


--
By by ... Detlef
---
 dlls/browseui/tests/Makefile.in   |    3 +-
 dlls/browseui/tests/progressdlg.c |   69 +++++++++++++++++++++++++++++++++++++
 2 files changed, 71 insertions(+), 1 deletions(-)
 create mode 100644 dlls/browseui/tests/progressdlg.c

diff --git a/dlls/browseui/tests/Makefile.in b/dlls/browseui/tests/Makefile.in
index 0cb3541..c3bc768 100644
--- a/dlls/browseui/tests/Makefile.in
+++ b/dlls/browseui/tests/Makefile.in
@@ -2,6 +2,7 @@ TESTDLL   = browseui.dll
 IMPORTS   = ole32
 
 C_SRCS = \
-	autocomplete.c
+	autocomplete.c \
+	progressdlg.c
 
 @MAKE_TEST_RULES@
diff --git a/dlls/browseui/tests/progressdlg.c b/dlls/browseui/tests/progressdlg.c
new file mode 100644
index 0000000..5bbef0a
--- /dev/null
+++ b/dlls/browseui/tests/progressdlg.c
@@ -0,0 +1,69 @@
+/* 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, (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();
+}
-- 
1.7.5.4




More information about the wine-patches mailing list