[PATCH 05/10] explorerframe/tests: Add initial NamespaceTreeControl tests.

David Hedberg david.hedberg at gmail.com
Sat Jul 31 13:02:49 CDT 2010


---
 configure.ac                         |    1 +
 dlls/explorerframe/tests/Makefile.in |   11 +++++
 dlls/explorerframe/tests/nstc.c      |   81 ++++++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+), 0 deletions(-)
 create mode 100644 dlls/explorerframe/tests/Makefile.in
 create mode 100644 dlls/explorerframe/tests/nstc.c

diff --git a/configure.ac b/configure.ac
index 1fad01c..fd07b21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2359,6 +2359,7 @@ WINE_CONFIG_DLL(dxgi,,[dxgi])
 WINE_CONFIG_TEST(dlls/dxgi/tests)
 WINE_CONFIG_LIB(dxguid)
 WINE_CONFIG_DLL(explorerframe,,[explorerframe])
+WINE_CONFIG_TEST(dlls/explorerframe/tests)
 WINE_CONFIG_DLL(faultrep)
 WINE_CONFIG_DLL(fltlib)
 WINE_CONFIG_DLL(fusion)
diff --git a/dlls/explorerframe/tests/Makefile.in b/dlls/explorerframe/tests/Makefile.in
new file mode 100644
index 0000000..880d19a
--- /dev/null
+++ b/dlls/explorerframe/tests/Makefile.in
@@ -0,0 +1,11 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../../..
+SRCDIR    = @srcdir@
+VPATH     = @srcdir@
+TESTDLL   = explorerframe.dll
+IMPORTS   = uuid user32 ole32
+
+C_SRCS = \
+	nstc.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/explorerframe/tests/nstc.c b/dlls/explorerframe/tests/nstc.c
new file mode 100644
index 0000000..bd0caf1
--- /dev/null
+++ b/dlls/explorerframe/tests/nstc.c
@@ -0,0 +1,81 @@
+/*
+ *    Unit tests for the NamespaceTree Control
+ *
+ * Copyright 2010 David Hedberg
+ *
+ * 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
+ */
+
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include "shlobj.h"
+#include "wine/test.h"
+
+static HWND hwnd;
+
+/* "Intended for internal use" */
+#define TVS_EX_NOSINGLECOLLAPSE 0x1
+
+/* Returns FALSE if the NamespaceTreeControl failed to be instantiated. */
+static BOOL test_initialization(void)
+{
+    INameSpaceTreeControl *pnstc;
+    HRESULT hr;
+
+    hr = CoCreateInstance(&CLSID_NamespaceTreeControl, NULL, CLSCTX_INPROC_SERVER,
+                          &IID_INameSpaceTreeControl, (void**)&pnstc);
+    ok(hr == S_OK || hr == REGDB_E_CLASSNOTREG, "Got 0x%08x\n", hr);
+    if(FAILED(hr))
+    {
+        return FALSE;
+    }
+
+    INameSpaceTreeControl_Release(pnstc);
+
+    return TRUE;
+}
+
+static void setup_window(void)
+{
+    WNDCLASSA wc;
+    static const char nstctest_wnd_name[] = "nstctest_wnd";
+
+    ZeroMemory(&wc, sizeof(WNDCLASSA));
+    wc.lpfnWndProc      = DefWindowProcA;
+    wc.lpszClassName    = nstctest_wnd_name;
+    RegisterClassA(&wc);
+    hwnd = CreateWindowA(nstctest_wnd_name, NULL, WS_TABSTOP,
+                         0, 0, 200, 200, NULL, 0, 0, NULL);
+    ok(hwnd != NULL, "Failed to create window for test (lasterror: %d).\n",
+       GetLastError());
+}
+
+static void destroy_window(void)
+{
+    DestroyWindow(hwnd);
+}
+
+START_TEST(nstc)
+{
+    OleInitialize(NULL);
+    setup_window();
+
+    test_initialization();
+
+    destroy_window();
+    OleUninitialize();
+}
-- 
1.7.2




More information about the wine-patches mailing list