https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ba54c5644e6947f9c6d6a…
commit ba54c5644e6947f9c6d6a7e15a6bd770bb077498
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Dec 18 13:43:24 2017 +0100
[MSHTML_WINETEST] Add a PCH.
---
modules/rostests/winetests/mshtml/CMakeLists.txt | 11 ++++++---
modules/rostests/winetests/mshtml/activex.c | 23 ++----------------
modules/rostests/winetests/mshtml/dom.c | 19 +--------------
modules/rostests/winetests/mshtml/events.c | 16 ++-----------
modules/rostests/winetests/mshtml/guid.c | 15 ++++++++++++
modules/rostests/winetests/mshtml/htmldoc.c | 27 ++++-----------------
modules/rostests/winetests/mshtml/htmllocation.c | 8 +------
modules/rostests/winetests/mshtml/misc.c | 9 +------
modules/rostests/winetests/mshtml/mshtml_test.h | 4 +++-
modules/rostests/winetests/mshtml/precomp.h | 28 ++++++++++++++++++++++
modules/rostests/winetests/mshtml/protocol.c | 11 +--------
modules/rostests/winetests/mshtml/script.c | 23 ++----------------
modules/rostests/winetests/mshtml/style.c | 14 +----------
modules/rostests/winetests/mshtml/xmlhttprequest.c | 10 +-------
14 files changed, 70 insertions(+), 148 deletions(-)
diff --git a/modules/rostests/winetests/mshtml/CMakeLists.txt
b/modules/rostests/winetests/mshtml/CMakeLists.txt
index 5384512e52..f744975c2f 100644
--- a/modules/rostests/winetests/mshtml/CMakeLists.txt
+++ b/modules/rostests/winetests/mshtml/CMakeLists.txt
@@ -13,10 +13,14 @@ list(APPEND SOURCE
protocol.c
script.c
style.c
- testlist.c
- xmlhttprequest.c)
+ xmlhttprequest.c
+ precomp.h)
-add_executable(mshtml_winetest ${SOURCE} rsrc.rc)
+add_executable(mshtml_winetest
+ ${SOURCE}
+ guid.c
+ testlist.c
+ rsrc.rc)
list(APPEND mshtml_winetest_rc_deps
${CMAKE_CURRENT_BINARY_DIR}/test_tlb.tlb
@@ -33,4 +37,5 @@ target_link_libraries(mshtml_winetest uuid strmiids)
set_module_type(mshtml_winetest win32cui)
add_importlibs(mshtml_winetest wininet ole32 oleaut32 user32 gdi32 urlmon advapi32 msvcrt
kernel32)
add_dependencies(mshtml_winetest test_tlb_header stdole2)
+add_pch(mshtml_winetest precomp.h SOURCE)
add_rostests_file(TARGET mshtml_winetest)
diff --git a/modules/rostests/winetests/mshtml/activex.c
b/modules/rostests/winetests/mshtml/activex.c
index c145b4ab54..117becd79a 100644
--- a/modules/rostests/winetests/mshtml/activex.c
+++ b/modules/rostests/winetests/mshtml/activex.c
@@ -16,27 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <wine/test.h>
-//#include <stdarg.h>
-#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <mshtml.h>
-//#include "docobj.h"
-#include <hlink.h>
-//#include "dispex.h"
-#include <mshtmhst.h>
-//#include "activscp.h"
-//#include "objsafe.h"
-#include <mshtmdid.h>
-#include "mshtml_test.h"
-
-#include <initguid.h>
+#include "precomp.h"
+
#include <test_tlb.h>
#define DEFINE_EXPECT(func) \
diff --git a/modules/rostests/winetests/mshtml/dom.c
b/modules/rostests/winetests/mshtml/dom.c
index 1874ead8b5..09d0c7fda2 100644
--- a/modules/rostests/winetests/mshtml/dom.c
+++ b/modules/rostests/winetests/mshtml/dom.c
@@ -16,27 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
+#include "precomp.h"
-#include <wine/test.h>
-//#include <stdarg.h>
#include <stdio.h>
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <mshtml.h>
-#include <mshtmcid.h>
-#include <mshtmhst.h>
-//#include "docobj.h"
-#include <hlink.h>
-//#include "dispex.h"
-#include "mshtml_test.h"
-#include <objsafe.h>
-#include <htiface.h>
-#include <tlogstg.h>
-
static INT (WINAPI *pLCIDToLocaleName)(LCID,LPWSTR,INT,DWORD);
static LANGID (WINAPI *pGetUserDefaultUILanguage)(void);
diff --git a/modules/rostests/winetests/mshtml/events.c
b/modules/rostests/winetests/mshtml/events.c
index b5f14b8445..e3218509f1 100644
--- a/modules/rostests/winetests/mshtml/events.c
+++ b/modules/rostests/winetests/mshtml/events.c
@@ -16,21 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <wine/test.h>
-//#include <stdarg.h>
-#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <mshtml.h>
-#include <mshtmdid.h>
+#include "precomp.h"
+
#include <docobj.h>
-#include <hlink.h>
-//#include "dispex.h"
#define DEFINE_EXPECT(func) \
static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
diff --git a/modules/rostests/winetests/mshtml/guid.c
b/modules/rostests/winetests/mshtml/guid.c
new file mode 100644
index 0000000000..49ddc82961
--- /dev/null
+++ b/modules/rostests/winetests/mshtml/guid.c
@@ -0,0 +1,15 @@
+/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
+
+#include <stdarg.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+
+#include <windef.h>
+#include <winbase.h>
+#include <objbase.h>
+#include <initguid.h>
+#include <dispex.h>
+#include <test_tlb.h>
+
+/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */
diff --git a/modules/rostests/winetests/mshtml/htmldoc.c
b/modules/rostests/winetests/mshtml/htmldoc.c
index 1ca1878b58..78583894f0 100644
--- a/modules/rostests/winetests/mshtml/htmldoc.c
+++ b/modules/rostests/winetests/mshtml/htmldoc.c
@@ -16,35 +16,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
+#include "precomp.h"
-#include <wine/test.h>
-//#include <stdarg.h>
-#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-#include <initguid.h>
-//#include "ole2.h"
-#include <mshtml.h>
-//#include "docobj.h"
-#include <docobjectservice.h>
-#include <wininet.h>
-#include <mshtmhst.h>
-#include <mshtmdid.h>
-#include <mshtmcid.h>
-//#include "hlink.h"
-//#include "dispex.h"
#include <idispids.h>
#include <shlguid.h>
#include <shdeprecated.h>
#include <perhist.h>
-//#include "shobjidl.h"
-#include <htiface.h>
-#include <tlogstg.h>
#include <exdispid.h>
-#include "mshtml_test.h"
+
+#include <initguid.h>
+#include <docobjectservice.h>
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
DEFINE_GUID(IID_IProxyManager,0x00000008,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
diff --git a/modules/rostests/winetests/mshtml/htmllocation.c
b/modules/rostests/winetests/mshtml/htmllocation.c
index 8bf5517dd5..e28e126db9 100644
--- a/modules/rostests/winetests/mshtml/htmllocation.c
+++ b/modules/rostests/winetests/mshtml/htmllocation.c
@@ -16,13 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <wine/test.h>
-
-#include "mshtml.h"
-#include "wininet.h"
+#include "precomp.h"
struct location_test {
const char *name;
diff --git a/modules/rostests/winetests/mshtml/misc.c
b/modules/rostests/winetests/mshtml/misc.c
index d57aabc354..b33b88db89 100644
--- a/modules/rostests/winetests/mshtml/misc.c
+++ b/modules/rostests/winetests/mshtml/misc.c
@@ -16,15 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
+#include "precomp.h"
-#include <wine/test.h>
-//#include <stdarg.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-//#include "initguid.h"
#include <optary.h>
static void test_HTMLLoadOptions(void)
diff --git a/modules/rostests/winetests/mshtml/mshtml_test.h
b/modules/rostests/winetests/mshtml/mshtml_test.h
index c0844958dc..b6d896ad33 100644
--- a/modules/rostests/winetests/mshtml/mshtml_test.h
+++ b/modules/rostests/winetests/mshtml/mshtml_test.h
@@ -16,9 +16,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#pragma once
+
/* Check if Internet Explorer is configured to run in "Enhanced Security
Configuration" (aka hardened mode) */
/* Note: this code is duplicated in dlls/mshtml/tests/mshtml_test.h and
dlls/urlmon/tests/sec_mgr.c */
-static BOOL is_ie_hardened(void)
+static inline BOOL is_ie_hardened(void)
{
HKEY zone_map;
DWORD ie_harden, type, size;
diff --git a/modules/rostests/winetests/mshtml/precomp.h
b/modules/rostests/winetests/mshtml/precomp.h
new file mode 100644
index 0000000000..acb5807b69
--- /dev/null
+++ b/modules/rostests/winetests/mshtml/precomp.h
@@ -0,0 +1,28 @@
+#ifndef _MSHTML_WINETEST_PRECOMP_H_
+#define _MSHTML_WINETEST_PRECOMP_H_
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <wine/test.h>
+
+#include <wingdi.h>
+#include <winnls.h>
+#include <ole2.h>
+#include <mshtml.h>
+#include <hlink.h>
+#include <mshtmhst.h>
+#include <mshtmdid.h>
+#include <mshtmcid.h>
+#include <objsafe.h>
+#include <htiface.h>
+#include <tlogstg.h>
+#include <winreg.h>
+#include <wininet.h>
+
+#include "mshtml_test.h"
+
+#endif /* !_MSHTML_WINETEST_PRECOMP_H_ */
diff --git a/modules/rostests/winetests/mshtml/protocol.c
b/modules/rostests/winetests/mshtml/protocol.c
index b90451e4fd..bda617c7ab 100644
--- a/modules/rostests/winetests/mshtml/protocol.c
+++ b/modules/rostests/winetests/mshtml/protocol.c
@@ -16,18 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
+#include "precomp.h"
-#include <wine/test.h>
-//#include <stdarg.h>
-#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <urlmon.h>
#include <shlwapi.h>
-#include <wininet.h>
#include <initguid.h>
diff --git a/modules/rostests/winetests/mshtml/script.c
b/modules/rostests/winetests/mshtml/script.c
index 1c5171bffc..102f994946 100644
--- a/modules/rostests/winetests/mshtml/script.c
+++ b/modules/rostests/winetests/mshtml/script.c
@@ -16,28 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <wine/test.h>
-//#include <stdarg.h>
-#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <wininet.h>
-//#include "docobj.h"
-//#include "dispex.h"
-#include <hlink.h>
-#include <mshtml.h>
-#include <mshtmhst.h>
-//#include "initguid.h"
-//#include "activscp.h"
+#include "precomp.h"
+
#include <activdbg.h>
-#include <objsafe.h>
-#include <mshtmdid.h>
-#include "mshtml_test.h"
DEFINE_GUID(CLSID_IdentityUnmarshal,0x0000001b,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46);
diff --git a/modules/rostests/winetests/mshtml/style.c
b/modules/rostests/winetests/mshtml/style.c
index 974ec2baae..71c432dd02 100644
--- a/modules/rostests/winetests/mshtml/style.c
+++ b/modules/rostests/winetests/mshtml/style.c
@@ -16,19 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-#define CONST_VTABLE
-
-#include <wine/test.h>
-//#include <stdarg.h>
-//#include <stdio.h>
-
-//#include "windef.h"
-//#include "winbase.h"
-//#include "ole2.h"
-#include <mshtml.h>
-//#include "mshtmhst.h"
-//#include "docobj.h"
+#include "precomp.h"
static int strcmp_wa(LPCWSTR strw, const char *stra)
{
diff --git a/modules/rostests/winetests/mshtml/xmlhttprequest.c
b/modules/rostests/winetests/mshtml/xmlhttprequest.c
index 09972068bb..8a4bd1793b 100644
--- a/modules/rostests/winetests/mshtml/xmlhttprequest.c
+++ b/modules/rostests/winetests/mshtml/xmlhttprequest.c
@@ -16,15 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define COBJMACROS
-
-#include <wine/test.h>
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "ole2.h"
-#include "mshtml.h"
+#include "precomp.h"
static BSTR a2bstr(const char *str)
{