Jacek Caban : atl100: Added AtlWinModuleInit tests.

Alexandre Julliard julliard at winehq.org
Tue Dec 18 13:49:06 CST 2012


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Dec 18 11:48:47 2012 +0100

atl100: Added AtlWinModuleInit tests.

---

 configure                     |    1 +
 configure.ac                  |    1 +
 dlls/atl100/tests/Makefile.in |    8 +++++
 dlls/atl100/tests/atl.c       |   63 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 7b3b31d..e19bf2b 100755
--- a/configure
+++ b/configure
@@ -15356,6 +15356,7 @@ wine_fn_config_dll appwiz.cpl enable_appwiz_cpl po
 wine_fn_config_dll atl enable_atl implib
 wine_fn_config_test dlls/atl/tests atl_test
 wine_fn_config_dll atl100 enable_atl100 implib
+wine_fn_config_test dlls/atl100/tests atl100_test
 wine_fn_config_dll atl80 enable_atl80
 wine_fn_config_dll authz enable_authz
 wine_fn_config_dll avicap32 enable_avicap32 implib
diff --git a/configure.ac b/configure.ac
index 3a07cbf..0036376 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2535,6 +2535,7 @@ WINE_CONFIG_DLL(appwiz.cpl,,[po])
 WINE_CONFIG_DLL(atl,,[implib])
 WINE_CONFIG_TEST(dlls/atl/tests)
 WINE_CONFIG_DLL(atl100,,[implib])
+WINE_CONFIG_TEST(dlls/atl100/tests)
 WINE_CONFIG_DLL(atl80)
 WINE_CONFIG_DLL(authz)
 WINE_CONFIG_DLL(avicap32,,[implib])
diff --git a/dlls/atl100/tests/Makefile.in b/dlls/atl100/tests/Makefile.in
new file mode 100644
index 0000000..4230bad
--- /dev/null
+++ b/dlls/atl100/tests/Makefile.in
@@ -0,0 +1,8 @@
+TESTDLL   = atl100.dll
+IMPORTS   = ole32 atl100
+EXTRADEFS = -D_ATL_VER=_ATL_VER_100
+
+C_SRCS = \
+	atl.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/atl100/tests/atl.c b/dlls/atl100/tests/atl.c
new file mode 100644
index 0000000..43d9bd5
--- /dev/null
+++ b/dlls/atl100/tests/atl.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2012 Jacek Caban for CodeWeavers
+ *
+ * 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 <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+
+#include <atlbase.h>
+
+#include <wine/test.h>
+
+static void test_winmodule(void)
+{
+    _ATL_WIN_MODULE winmod;
+    HRESULT hres;
+
+    winmod.cbSize = 0xdeadbeef;
+    hres = AtlWinModuleInit(&winmod);
+    ok(hres == E_INVALIDARG, "AtlWinModuleInit failed: %08x\n", hres);
+
+    winmod.cbSize = sizeof(winmod);
+    winmod.m_pCreateWndList = (void*)0xdeadbeef;
+    winmod.m_csWindowCreate.LockCount = 0xdeadbeef;
+    winmod.m_rgWindowClassAtoms.m_aT = (void*)0xdeadbeef;
+    winmod.m_rgWindowClassAtoms.m_nSize = 0xdeadbeef;
+    winmod.m_rgWindowClassAtoms.m_nAllocSize = 0xdeadbeef;
+    hres = AtlWinModuleInit(&winmod);
+    ok(hres == S_OK, "AtlWinModuleInit failed: %08x\n", hres);
+    ok(!winmod.m_pCreateWndList, "winmod.m_pCreateWndList = %p\n", winmod.m_pCreateWndList);
+    ok(winmod.m_csWindowCreate.LockCount == -1, "winmod.m_csWindowCreate.LockCount = %d\n",
+       winmod.m_csWindowCreate.LockCount);
+    ok(winmod.m_rgWindowClassAtoms.m_aT == (void*)0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_aT = %p\n",
+       winmod.m_rgWindowClassAtoms.m_aT);
+    ok(winmod.m_rgWindowClassAtoms.m_nSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nSize = %d\n",
+       winmod.m_rgWindowClassAtoms.m_nSize);
+    ok(winmod.m_rgWindowClassAtoms.m_nAllocSize == 0xdeadbeef, "winmod.m_rgWindowClassAtoms.m_nAllocSize = %d\n",
+       winmod.m_rgWindowClassAtoms.m_nAllocSize);
+}
+
+START_TEST(atl)
+{
+    CoInitialize(NULL);
+
+    test_winmodule();
+
+    CoUninitialize();
+}




More information about the wine-cvs mailing list