gdiplus/tests: Fix tests compilation with __WINESRC__ defined.

This commit is contained in:
Dmitry Timoshkov 2013-10-16 12:49:40 +09:00 committed by Alexandre Julliard
parent fc0c0be1a3
commit 1c8d4aaa4b
13 changed files with 33 additions and 36 deletions

View File

@ -1,6 +1,5 @@
TESTDLL = gdiplus.dll
IMPORTS = gdiplus ole32 user32 gdi32
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
C_SRCS = \
brush.c \

View File

@ -18,10 +18,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include <math.h>
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
#include <math.h>
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"

View File

@ -21,7 +21,7 @@
#include <math.h>
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
@ -731,7 +731,7 @@ static void test_font_substitution(void)
WCHAR ms_shell_dlg[LF_FACESIZE];
HDC hdc;
HFONT hfont;
LOGFONT lf;
LOGFONTA lf;
GpStatus status;
GpGraphics *graphics;
GpFont *font;
@ -746,9 +746,9 @@ static void test_font_substitution(void)
ok(hfont != 0, "GetStockObject(DEFAULT_GUI_FONT) failed\n");
memset(&lf, 0xfe, sizeof(lf));
ret = GetObject(hfont, sizeof(lf), &lf);
ret = GetObjectA(hfont, sizeof(lf), &lf);
ok(ret == sizeof(lf), "GetObject failed\n");
ok(!lstrcmp(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName);
ok(!lstrcmpA(lf.lfFaceName, "MS Shell Dlg"), "wrong face name %s\n", lf.lfFaceName);
MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, -1, ms_shell_dlg, LF_FACESIZE);
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
@ -756,8 +756,8 @@ static void test_font_substitution(void)
memset(&lf, 0xfe, sizeof(lf));
status = GdipGetLogFontA(font, graphics, &lf);
expect(Ok, status);
ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
!lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
!lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
GdipDeleteFont(font);
status = GdipCreateFontFamilyFromName(ms_shell_dlg, NULL, &family);
@ -767,21 +767,21 @@ static void test_font_substitution(void)
memset(&lf, 0xfe, sizeof(lf));
status = GdipGetLogFontA(font, graphics, &lf);
expect(Ok, status);
ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
!lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
!lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
GdipDeleteFont(font);
GdipDeleteFontFamily(family);
status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family);
ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
expect(Ok, status);
memset(&lf, 0xfe, sizeof(lf));
status = GdipGetLogFontA(font, graphics, &lf);
expect(Ok, status);
ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
GdipDeleteFont(font);
/* empty FaceName */
@ -791,13 +791,13 @@ static void test_font_substitution(void)
memset(&lf, 0xfe, sizeof(lf));
status = GdipGetLogFontA(font, graphics, &lf);
expect(Ok, status);
ok(!lstrcmp(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
ok(!lstrcmpA(lf.lfFaceName, "Arial"), "wrong face name %s\n", lf.lfFaceName);
GdipDeleteFont(font);
/* zeroing out lfWeight and lfCharSet leads to font creation failure */
lf.lfWeight = 0;
lf.lfCharSet = 0;
lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
todo_wine
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
@ -819,7 +819,7 @@ static void test_font_transform(void)
static const WCHAR string[] = { 'A',0 };
GpStatus status;
HDC hdc;
LOGFONT lf;
LOGFONTA lf;
GpFont *font;
GpGraphics *graphics;
GpMatrix *matrix;
@ -841,7 +841,7 @@ static void test_font_transform(void)
expect(Ok, status);
memset(&lf, 0, sizeof(lf));
lstrcpy(lf.lfFaceName, "Tahoma");
lstrcpyA(lf.lfFaceName, "Tahoma");
lf.lfHeight = -100;
lf.lfWidth = 100;
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);

View File

@ -22,9 +22,8 @@
#include <math.h>
#include <assert.h>
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wingdi.h"
#include "wine/test.h"
#define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got))
@ -5506,8 +5505,8 @@ START_TEST(graphics)
class.style = CS_HREDRAW | CS_VREDRAW;
class.lpfnWndProc = DefWindowProcA;
class.hInstance = GetModuleHandleA(0);
class.hIcon = LoadIcon(0, IDI_APPLICATION);
class.hCursor = LoadCursor(NULL, IDC_ARROW);
class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
RegisterClassA( &class );
hwnd = CreateWindowA( "gdiplus_test", "graphics test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
#include <math.h>

View File

@ -26,7 +26,7 @@
#include <stdio.h>
#include "initguid.h"
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
@ -3809,7 +3809,7 @@ static void test_image_format(void)
else
{
expect(Ok, status);
ret = GetObject(hbitmap, sizeof(bm), &bm);
ret = GetObjectW(hbitmap, sizeof(bm), &bm);
expect(sizeof(bm), ret);
expect(0, bm.bmType);
expect(1, bm.bmWidth);

View File

@ -20,8 +20,7 @@
#include <math.h>
#include "windows.h"
#include <stdio.h>
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"

View File

@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include <stdio.h>
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"

View File

@ -20,7 +20,7 @@
#include <math.h>
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"

View File

@ -18,12 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include "gdiplus.h"
#include "wingdi.h"
#include "wine/test.h"
#include <math.h>
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"
#define RGNDATA_RECT 0x10000000
#define RGNDATA_PATH 0x10000001
#define RGNDATA_EMPTY_RECT 0x10000002

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windows.h"
#include "objbase.h"
#include "gdiplus.h"
#include "wine/test.h"