[OLEAUT32_WINETEST] Add a PCH.

This commit is contained in:
Amine Khaldi 2017-12-20 13:21:11 +01:00
parent 2cd1c84f7f
commit de6d0f24bc
13 changed files with 55 additions and 216 deletions

View file

@ -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)

View file

@ -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};

View file

@ -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);

View file

@ -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);
}

View file

@ -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_ */

View file

@ -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;

View file

@ -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);

View file

@ -17,6 +17,8 @@
*
*/
#pragma once
#define DISPID_TM_NAME 1
#define DISPID_TM_DOSOMETHING 2
#define DISPID_TM_STATE 3

View file

@ -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")

View file

@ -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)

View file

@ -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;

View file

@ -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*);

View file

@ -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>