https://git.reactos.org/?p=reactos.git;a=commitdiff;h=de6d0f24bc768e476996a0...
commit de6d0f24bc768e476996a03e04928a4a864dd31c Author: Amine Khaldi amine.khaldi@reactos.org AuthorDate: Wed Dec 20 13:21:11 2017 +0100
[OLEAUT32_WINETEST] Add a PCH. --- modules/rostests/winetests/oleaut32/CMakeLists.txt | 7 +-- modules/rostests/winetests/oleaut32/dispatch.c | 14 +---- modules/rostests/winetests/oleaut32/olefont.c | 25 +-------- modules/rostests/winetests/oleaut32/olepicture.c | 59 +++++++--------------- modules/rostests/winetests/oleaut32/precomp.h | 23 +++++++++ modules/rostests/winetests/oleaut32/safearray.c | 24 +-------- modules/rostests/winetests/oleaut32/tmarshal.c | 19 +------ .../rostests/winetests/oleaut32/tmarshal_dispids.h | 2 + modules/rostests/winetests/oleaut32/typelib.c | 22 +------- modules/rostests/winetests/oleaut32/usrmarshal.c | 17 +------ modules/rostests/winetests/oleaut32/varformat.c | 22 +------- modules/rostests/winetests/oleaut32/vartest.c | 23 +-------- modules/rostests/winetests/oleaut32/vartype.c | 14 +---- 13 files changed, 55 insertions(+), 216 deletions(-)
diff --git a/modules/rostests/winetests/oleaut32/CMakeLists.txt b/modules/rostests/winetests/oleaut32/CMakeLists.txt index e1d61fee9b..bd9c0f47b6 100644 --- a/modules/rostests/winetests/oleaut32/CMakeLists.txt +++ b/modules/rostests/winetests/oleaut32/CMakeLists.txt @@ -10,7 +10,6 @@ list(APPEND SOURCE olefont.c olepicture.c safearray.c - testlist.c tmarshal.c typelib.c usrmarshal.c @@ -19,7 +18,8 @@ list(APPEND SOURCE vartype.c ${CMAKE_CURRENT_BINARY_DIR}/test_reg_i.c ${CMAKE_CURRENT_BINARY_DIR}/test_tlb_i.c - ${CMAKE_CURRENT_BINARY_DIR}/tmarshal_i.c) + ${CMAKE_CURRENT_BINARY_DIR}/tmarshal_i.c + precomp.h)
set(tmarshal.rc_DEPS ${CMAKE_CURRENT_BINARY_DIR}/test_reg.tlb @@ -27,7 +27,7 @@ set(tmarshal.rc_DEPS ${CMAKE_CURRENT_BINARY_DIR}/tmarshal.tlb)
set_source_files_properties(tmarshal.rc PROPERTIES OBJECT_DEPENDS "${tmarshal.rc_DEPS}") -add_executable(oleaut32_winetest ${SOURCE} tmarshal.rc) +add_executable(oleaut32_winetest ${SOURCE} testlist.c tmarshal.rc) target_link_libraries(oleaut32_winetest uuid) set_module_type(oleaut32_winetest win32cui) add_importlibs(oleaut32_winetest oleaut32 ole32 rpcrt4 user32 gdi32 advapi32 msvcrt kernel32) @@ -37,4 +37,5 @@ if(MSVC) endif()
add_dependencies(oleaut32_winetest stdole2 oleaut32_idlheaders) +add_pch(oleaut32_winetest precomp.h SOURCE) add_rostests_file(TARGET oleaut32_winetest) diff --git a/modules/rostests/winetests/oleaut32/dispatch.c b/modules/rostests/winetests/oleaut32/dispatch.c index d5ac4f0383..722488da31 100644 --- a/modules/rostests/winetests/oleaut32/dispatch.c +++ b/modules/rostests/winetests/oleaut32/dispatch.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define CONST_VTABLE - -#include <wine/test.h> -//#include <windef.h> -//#include <winbase.h> -#include <winnls.h> -#include <ole2.h> -//#include <oaidl.h> +#include "precomp.h"
static const WCHAR szSunshine[] = {'S','u','n','s','h','i','n','e',0};
diff --git a/modules/rostests/winetests/oleaut32/olefont.c b/modules/rostests/winetests/oleaut32/olefont.c index 5cf4987173..9763271208 100644 --- a/modules/rostests/winetests/oleaut32/olefont.c +++ b/modules/rostests/winetests/oleaut32/olefont.c @@ -20,30 +20,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include <stdarg.h> -//#include <stdio.h> -//#include <math.h> -//#include <float.h> - -#define COBJMACROS - -#include <wine/test.h> -//#include <windef.h> -//#include <winbase.h> -//#include <winuser.h> -#include <wingdi.h> -//#include <winnls.h> -//#include <winerror.h> -//#include <winnt.h> -//#include <initguid.h> -//#include <wtypes.h> -#include <ole2.h> -#include <olectl.h> -//#include <ocidl.h> +#include "precomp.h"
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
diff --git a/modules/rostests/winetests/oleaut32/olepicture.c b/modules/rostests/winetests/oleaut32/olepicture.c index 1b8e3957cc..02d68a4171 100644 --- a/modules/rostests/winetests/oleaut32/olepicture.c +++ b/modules/rostests/winetests/oleaut32/olepicture.c @@ -19,32 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include <stdarg.h> -#include <stdio.h> -//#include <math.h> -//#include <float.h> - -#define COBJMACROS -#define CONST_VTABLE -#define NONAMELESSUNION - -#include <wine/test.h> -//#include <windef.h> -//#include <winbase.h> -//#include <winuser.h> -#include <wingdi.h> -#include <winnls.h> -//#include <winerror.h> -//#include <winnt.h> -#include <ole2.h> -//#include <urlmon.h> -//#include <wtypes.h> -#include <olectl.h> -//#include <objidl.h> +#include "precomp.h"
#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
@@ -761,8 +736,8 @@ static void test_Render(void)
desc.cbSizeofstruct = sizeof(PICTDESC); desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); - if(!desc.u.icon.hicon){ + desc.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + if(!desc.icon.hicon){ win_skip("LoadIcon failed. Skipping...\n"); delete_render_dc(hdc); return; @@ -1065,14 +1040,14 @@ static void test_himetric(void)
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_BITMAP; - desc.u.bmp.hpal = NULL; + desc.bmp.hpal = NULL;
hdc = CreateCompatibleDC(0);
bmp = CreateBitmap(1.9 * GetDeviceCaps(hdc, LOGPIXELSX), 1.9 * GetDeviceCaps(hdc, LOGPIXELSY), 1, 1, NULL);
- desc.u.bmp.hbitmap = bmp; + desc.bmp.hbitmap = bmp;
/* size in himetric units reported rounded up to next integer value */ hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); @@ -1099,7 +1074,7 @@ static void test_himetric(void) ok(icon != NULL, "failed to create icon\n");
desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = icon; + desc.icon.hicon = icon;
hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1138,8 +1113,8 @@ static void test_load_save_bmp(void)
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_BITMAP; - desc.u.bmp.hpal = 0; - desc.u.bmp.hbitmap = CreateBitmap(1, 1, 1, 1, NULL); + desc.bmp.hpal = 0; + desc.bmp.hbitmap = CreateBitmap(1, 1, 1, 1, NULL); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
@@ -1150,7 +1125,7 @@ static void test_load_save_bmp(void)
hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.bmp.hbitmap, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.bmp.hbitmap, "get_Handle returned wrong handle %#x\n", handle);
hmem = GlobalAlloc(GMEM_ZEROINIT, 4096); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1190,7 +1165,7 @@ static void test_load_save_bmp(void) GlobalUnlock(hmem); GlobalFree(hmem);
- DeleteObject(desc.u.bmp.hbitmap); + DeleteObject(desc.bmp.hbitmap); IPicture_Release(pic); }
@@ -1210,7 +1185,7 @@ static void test_load_save_icon(void)
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_ICON; - desc.u.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + desc.icon.hicon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
@@ -1221,7 +1196,7 @@ static void test_load_save_icon(void)
hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.icon.hicon, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.icon.hicon, "get_Handle returned wrong handle %#x\n", handle);
hmem = GlobalAlloc(GMEM_ZEROINIT, 8192); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1263,7 +1238,7 @@ todo_wine GlobalUnlock(hmem); GlobalFree(hmem);
- DestroyIcon(desc.u.icon.hicon); + DestroyIcon(desc.icon.hicon); IPicture_Release(pic); }
@@ -1397,8 +1372,8 @@ static void test_load_save_emf(void)
desc.cbSizeofstruct = sizeof(desc); desc.picType = PICTYPE_ENHMETAFILE; - desc.u.emf.hemf = CloseEnhMetaFile(hdc); - ok(desc.u.emf.hemf != 0, "CloseEnhMetaFile failed\n"); + desc.emf.hemf = CloseEnhMetaFile(hdc); + ok(desc.emf.hemf != 0, "CloseEnhMetaFile failed\n"); hr = OleCreatePictureIndirect(&desc, &IID_IPicture, FALSE, (void**)&pic); ok(hr == S_OK, "OleCreatePictureIndirect error %#x\n", hr);
@@ -1409,7 +1384,7 @@ static void test_load_save_emf(void)
hr = IPicture_get_Handle(pic, &handle); ok(hr == S_OK,"get_Handle error %#8x\n", hr); - ok(IntToPtr(handle) == desc.u.emf.hemf, "get_Handle returned wrong handle %#x\n", handle); + ok(IntToPtr(handle) == desc.emf.hemf, "get_Handle returned wrong handle %#x\n", handle);
hmem = GlobalAlloc(GMEM_MOVEABLE, 0); hr = CreateStreamOnHGlobal(hmem, FALSE, &dst_stream); @@ -1455,7 +1430,7 @@ if (size) GlobalUnlock(hmem); GlobalFree(hmem);
- DeleteEnhMetaFile(desc.u.emf.hemf); + DeleteEnhMetaFile(desc.emf.hemf); IPicture_Release(pic); }
diff --git a/modules/rostests/winetests/oleaut32/precomp.h b/modules/rostests/winetests/oleaut32/precomp.h new file mode 100644 index 0000000000..eb417ca71f --- /dev/null +++ b/modules/rostests/winetests/oleaut32/precomp.h @@ -0,0 +1,23 @@ +#ifndef _OLEAUT32_WINETEST_PRECOMP_H_ +#define _OLEAUT32_WINETEST_PRECOMP_H_ + +#include <stdio.h> +#include <math.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#define COBJMACROS +#define CONST_VTABLE + +#include <wine/test.h> + +#include <winnls.h> +#include <wingdi.h> +#include <ole2.h> +#include <olectl.h> +#include <tmarshal.h> +#include <test_tlb.h> + +#endif /* !_OLEAUT32_WINETEST_PRECOMP_H_ */ diff --git a/modules/rostests/winetests/oleaut32/safearray.c b/modules/rostests/winetests/oleaut32/safearray.c index a73829dead..06dbb269a6 100644 --- a/modules/rostests/winetests/oleaut32/safearray.c +++ b/modules/rostests/winetests/oleaut32/safearray.c @@ -19,29 +19,7 @@ * */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include <stdarg.h> -#include <stdio.h> -//#include <math.h> -//#include <float.h> - -#define COBJMACROS -#define CONST_VTABLE -#include <wine/test.h> -//#include "windef.h" -//#include "winbase.h" -//#include "winuser.h" -//#include "wingdi.h" -//#include "winnls.h" -//#include "winsock.h" -//#include "winerror.h" -//#include "winnt.h" -#include <objbase.h> -//#include "wtypes.h" -#include <oleauto.h> +#include "precomp.h"
#ifndef FADF_CREATEVECTOR const USHORT FADF_CREATEVECTOR = 0x2000; diff --git a/modules/rostests/winetests/oleaut32/tmarshal.c b/modules/rostests/winetests/oleaut32/tmarshal.c index 8ee2f808bf..c801494c49 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal.c +++ b/modules/rostests/winetests/oleaut32/tmarshal.c @@ -17,25 +17,8 @@ * */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h"
-#define COBJMACROS -#define CONST_VTABLE - -//#include <windows.h> -#include <stdarg.h> -#include <windef.h> -#include <winbase.h> -#include <winnls.h> -#include <ole2.h> -//#include <ocidl.h> -//#include <stdio.h> - -#include <wine/test.h> - -#include <tmarshal.h> #include "tmarshal_dispids.h"
static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT); diff --git a/modules/rostests/winetests/oleaut32/tmarshal_dispids.h b/modules/rostests/winetests/oleaut32/tmarshal_dispids.h index 26f40273bf..9cdc12a7b7 100644 --- a/modules/rostests/winetests/oleaut32/tmarshal_dispids.h +++ b/modules/rostests/winetests/oleaut32/tmarshal_dispids.h @@ -17,6 +17,8 @@ * */
+#pragma once + #define DISPID_TM_NAME 1 #define DISPID_TM_DOSOMETHING 2 #define DISPID_TM_STATE 3 diff --git a/modules/rostests/winetests/oleaut32/typelib.c b/modules/rostests/winetests/oleaut32/typelib.c index 8d5687f71e..c6626991c0 100644 --- a/modules/rostests/winetests/oleaut32/typelib.c +++ b/modules/rostests/winetests/oleaut32/typelib.c @@ -19,30 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h"
-#define COBJMACROS -#define CONST_VTABLE - -#include <wine/test.h> -//#include <stdarg.h> -#include <stdio.h> - -//#include "windef.h" -//#include "winbase.h" -#include <winnls.h> #include <winreg.h> -#include <objbase.h> -#include <oleauto.h> -//#include "ocidl.h" -//#include "shlwapi.h" -#include <tmarshal.h> -#include <olectl.h> - #include <test_reg.h> -#include <test_tlb.h>
#define expect_eq(expr, value, type, format) { type _ret = (expr); ok((value) == _ret, #expr " expected " format " got " format "\n", value, _ret); } #define expect_int(expr, value) expect_eq(expr, (int)(value), int, "%d") diff --git a/modules/rostests/winetests/oleaut32/usrmarshal.c b/modules/rostests/winetests/oleaut32/usrmarshal.c index 924183e9aa..d570842a4e 100644 --- a/modules/rostests/winetests/oleaut32/usrmarshal.c +++ b/modules/rostests/winetests/oleaut32/usrmarshal.c @@ -18,22 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define COBJMACROS -#define CONST_VTABLE - -#include <stdarg.h> - -#include <windef.h> -#include <winbase.h> -#include <ole2.h> -//#include "objbase.h" -//#include "propidl.h" /* for LPSAFEARRAY_User* routines */ - -#include <wine/test.h> +#include "precomp.h"
#if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION) # define V_U2(A) ((A)->n1.n2) diff --git a/modules/rostests/winetests/oleaut32/varformat.c b/modules/rostests/winetests/oleaut32/varformat.c index cabab801b7..78faa277e4 100644 --- a/modules/rostests/winetests/oleaut32/varformat.c +++ b/modules/rostests/winetests/oleaut32/varformat.c @@ -19,27 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -//#include <stdarg.h> -//#include <stdio.h> -//#include <math.h> -//#include <float.h> - -//#include "windef.h" -//#include "winbase.h" -//#include "winsock.h" -#include <wine/test.h> -//#include "winuser.h" -//#include "wingdi.h" -#include <winnls.h> -//#include "winerror.h" -//#include "winnt.h" -#include <objbase.h> -//#include "wtypes.h" -#include <oleauto.h> +#include "precomp.h"
static HMODULE hOleaut32;
diff --git a/modules/rostests/winetests/oleaut32/vartest.c b/modules/rostests/winetests/oleaut32/vartest.c index 770ca82680..38eb1806a8 100644 --- a/modules/rostests/winetests/oleaut32/vartest.c +++ b/modules/rostests/winetests/oleaut32/vartest.c @@ -19,31 +19,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H +#include "precomp.h"
-//#include <stdarg.h> -#include <stdio.h> -#include <math.h> #include <float.h>
-#define COBJMACROS -#define CONST_VTABLE - -//#include "windef.h" -//#include "winbase.h" -//#include "winsock.h" -#include <wine/test.h> -//#include "winuser.h" -//#include "wingdi.h" -#include <winnls.h> -//#include "winerror.h" -//#include "winnt.h" -#include <objbase.h> -//#include "wtypes.h" -#include <oleauto.h> - static HMODULE hOleaut32;
static HRESULT (WINAPI *pVarUdateFromDate)(DATE,ULONG,UDATE*); diff --git a/modules/rostests/winetests/oleaut32/vartype.c b/modules/rostests/winetests/oleaut32/vartype.c index e6a577c844..5086e4b500 100644 --- a/modules/rostests/winetests/oleaut32/vartype.c +++ b/modules/rostests/winetests/oleaut32/vartype.c @@ -18,19 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define WIN32_NO_STATUS -#define _INC_WINDOWS -#define COM_NO_WINDOWS_H - -#define CONST_VTABLE -#define COBJMACROS - -#include <wine/test.h> -#include <winnls.h> -#include <objbase.h> -#include <oleauto.h> -#include <math.h> -#include <test_tlb.h> +#include "precomp.h"
#include <initguid.h>