gdiplus/tests: Fix tests compilation with __WINESRC__ defined.
This commit is contained in:
parent
fc0c0be1a3
commit
1c8d4aaa4b
|
@ -1,6 +1,5 @@
|
||||||
TESTDLL = gdiplus.dll
|
TESTDLL = gdiplus.dll
|
||||||
IMPORTS = gdiplus ole32 user32 gdi32
|
IMPORTS = gdiplus ole32 user32 gdi32
|
||||||
EXTRADEFS = -U__WINESRC__ -DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS
|
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
brush.c \
|
brush.c \
|
||||||
|
|
|
@ -18,10 +18,11 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* 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 "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
|
#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)
|
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
@ -731,7 +731,7 @@ static void test_font_substitution(void)
|
||||||
WCHAR ms_shell_dlg[LF_FACESIZE];
|
WCHAR ms_shell_dlg[LF_FACESIZE];
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT hfont;
|
HFONT hfont;
|
||||||
LOGFONT lf;
|
LOGFONTA lf;
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
GpGraphics *graphics;
|
GpGraphics *graphics;
|
||||||
GpFont *font;
|
GpFont *font;
|
||||||
|
@ -746,9 +746,9 @@ static void test_font_substitution(void)
|
||||||
ok(hfont != 0, "GetStockObject(DEFAULT_GUI_FONT) failed\n");
|
ok(hfont != 0, "GetStockObject(DEFAULT_GUI_FONT) failed\n");
|
||||||
|
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
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(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);
|
MultiByteToWideChar(CP_ACP, 0, lf.lfFaceName, -1, ms_shell_dlg, LF_FACESIZE);
|
||||||
|
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
|
@ -756,8 +756,8 @@ static void test_font_substitution(void)
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
memset(&lf, 0xfe, sizeof(lf));
|
||||||
status = GdipGetLogFontA(font, graphics, &lf);
|
status = GdipGetLogFontA(font, graphics, &lf);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
|
ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
|
||||||
!lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
|
!lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
|
||||||
GdipDeleteFont(font);
|
GdipDeleteFont(font);
|
||||||
|
|
||||||
status = GdipCreateFontFamilyFromName(ms_shell_dlg, NULL, &family);
|
status = GdipCreateFontFamilyFromName(ms_shell_dlg, NULL, &family);
|
||||||
|
@ -767,21 +767,21 @@ static void test_font_substitution(void)
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
memset(&lf, 0xfe, sizeof(lf));
|
||||||
status = GdipGetLogFontA(font, graphics, &lf);
|
status = GdipGetLogFontA(font, graphics, &lf);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
ok(!lstrcmp(lf.lfFaceName, "Microsoft Sans Serif") ||
|
ok(!lstrcmpA(lf.lfFaceName, "Microsoft Sans Serif") ||
|
||||||
!lstrcmp(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
|
!lstrcmpA(lf.lfFaceName, "Tahoma"), "wrong face name %s\n", lf.lfFaceName);
|
||||||
GdipDeleteFont(font);
|
GdipDeleteFont(font);
|
||||||
GdipDeleteFontFamily(family);
|
GdipDeleteFontFamily(family);
|
||||||
|
|
||||||
status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family);
|
status = GdipCreateFontFamilyFromName(nonexistent, NULL, &family);
|
||||||
ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
|
ok(status == FontFamilyNotFound, "expected FontFamilyNotFound, got %d\n", status);
|
||||||
|
|
||||||
lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
|
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
memset(&lf, 0xfe, sizeof(lf));
|
||||||
status = GdipGetLogFontA(font, graphics, &lf);
|
status = GdipGetLogFontA(font, graphics, &lf);
|
||||||
expect(Ok, status);
|
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);
|
GdipDeleteFont(font);
|
||||||
|
|
||||||
/* empty FaceName */
|
/* empty FaceName */
|
||||||
|
@ -791,13 +791,13 @@ static void test_font_substitution(void)
|
||||||
memset(&lf, 0xfe, sizeof(lf));
|
memset(&lf, 0xfe, sizeof(lf));
|
||||||
status = GdipGetLogFontA(font, graphics, &lf);
|
status = GdipGetLogFontA(font, graphics, &lf);
|
||||||
expect(Ok, status);
|
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);
|
GdipDeleteFont(font);
|
||||||
|
|
||||||
/* zeroing out lfWeight and lfCharSet leads to font creation failure */
|
/* zeroing out lfWeight and lfCharSet leads to font creation failure */
|
||||||
lf.lfWeight = 0;
|
lf.lfWeight = 0;
|
||||||
lf.lfCharSet = 0;
|
lf.lfCharSet = 0;
|
||||||
lstrcpy(lf.lfFaceName, "ThisFontShouldNotExist");
|
lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist");
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */
|
||||||
|
@ -819,7 +819,7 @@ static void test_font_transform(void)
|
||||||
static const WCHAR string[] = { 'A',0 };
|
static const WCHAR string[] = { 'A',0 };
|
||||||
GpStatus status;
|
GpStatus status;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
LOGFONT lf;
|
LOGFONTA lf;
|
||||||
GpFont *font;
|
GpFont *font;
|
||||||
GpGraphics *graphics;
|
GpGraphics *graphics;
|
||||||
GpMatrix *matrix;
|
GpMatrix *matrix;
|
||||||
|
@ -841,7 +841,7 @@ static void test_font_transform(void)
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
|
|
||||||
memset(&lf, 0, sizeof(lf));
|
memset(&lf, 0, sizeof(lf));
|
||||||
lstrcpy(lf.lfFaceName, "Tahoma");
|
lstrcpyA(lf.lfFaceName, "Tahoma");
|
||||||
lf.lfHeight = -100;
|
lf.lfHeight = -100;
|
||||||
lf.lfWidth = 100;
|
lf.lfWidth = 100;
|
||||||
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
status = GdipCreateFontFromLogfontA(hdc, &lf, &font);
|
||||||
|
|
|
@ -22,9 +22,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wingdi.h"
|
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
#define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got))
|
#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.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
class.lpfnWndProc = DefWindowProcA;
|
class.lpfnWndProc = DefWindowProcA;
|
||||||
class.hInstance = GetModuleHandleA(0);
|
class.hInstance = GetModuleHandleA(0);
|
||||||
class.hIcon = LoadIcon(0, IDI_APPLICATION);
|
class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
|
||||||
class.hCursor = LoadCursor(NULL, IDC_ARROW);
|
class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
|
||||||
class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
class.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||||
RegisterClassA( &class );
|
RegisterClassA( &class );
|
||||||
hwnd = CreateWindowA( "gdiplus_test", "graphics test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
hwnd = CreateWindowA( "gdiplus_test", "graphics test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "initguid.h"
|
#include "initguid.h"
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
@ -3809,7 +3809,7 @@ static void test_image_format(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
expect(Ok, status);
|
expect(Ok, status);
|
||||||
ret = GetObject(hbitmap, sizeof(bm), &bm);
|
ret = GetObjectW(hbitmap, sizeof(bm), &bm);
|
||||||
expect(sizeof(bm), ret);
|
expect(sizeof(bm), ret);
|
||||||
expect(0, bm.bmType);
|
expect(0, bm.bmType);
|
||||||
expect(1, bm.bmWidth);
|
expect(1, bm.bmWidth);
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include <stdio.h>
|
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,12 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* 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 <math.h>
|
||||||
|
|
||||||
|
#include "objbase.h"
|
||||||
|
#include "gdiplus.h"
|
||||||
|
#include "wine/test.h"
|
||||||
|
|
||||||
#define RGNDATA_RECT 0x10000000
|
#define RGNDATA_RECT 0x10000000
|
||||||
#define RGNDATA_PATH 0x10000001
|
#define RGNDATA_PATH 0x10000001
|
||||||
#define RGNDATA_EMPTY_RECT 0x10000002
|
#define RGNDATA_EMPTY_RECT 0x10000002
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "windows.h"
|
#include "objbase.h"
|
||||||
#include "gdiplus.h"
|
#include "gdiplus.h"
|
||||||
#include "wine/test.h"
|
#include "wine/test.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue