From 1c8d4aaa4b31c2cb041a05c83e14250515d6760a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 16 Oct 2013 12:49:40 +0900 Subject: [PATCH] gdiplus/tests: Fix tests compilation with __WINESRC__ defined. --- dlls/gdiplus/tests/Makefile.in | 1 - dlls/gdiplus/tests/brush.c | 5 +++-- dlls/gdiplus/tests/customlinecap.c | 2 +- dlls/gdiplus/tests/font.c | 28 ++++++++++++++-------------- dlls/gdiplus/tests/graphics.c | 7 +++---- dlls/gdiplus/tests/graphicspath.c | 2 +- dlls/gdiplus/tests/image.c | 4 ++-- dlls/gdiplus/tests/matrix.c | 3 +-- dlls/gdiplus/tests/metafile.c | 3 +-- dlls/gdiplus/tests/pathiterator.c | 2 +- dlls/gdiplus/tests/pen.c | 2 +- dlls/gdiplus/tests/region.c | 8 ++++---- dlls/gdiplus/tests/stringformat.c | 2 +- 13 files changed, 33 insertions(+), 36 deletions(-) diff --git a/dlls/gdiplus/tests/Makefile.in b/dlls/gdiplus/tests/Makefile.in index c6526fc94e5..1538eb089a3 100644 --- a/dlls/gdiplus/tests/Makefile.in +++ b/dlls/gdiplus/tests/Makefile.in @@ -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 \ diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index cde7b564e22..0942e880fc0 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -18,10 +18,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "windows.h" +#include + +#include "objbase.h" #include "gdiplus.h" #include "wine/test.h" -#include #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) diff --git a/dlls/gdiplus/tests/customlinecap.c b/dlls/gdiplus/tests/customlinecap.c index 604589eb2af..f70c134355c 100644 --- a/dlls/gdiplus/tests/customlinecap.c +++ b/dlls/gdiplus/tests/customlinecap.c @@ -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" diff --git a/dlls/gdiplus/tests/font.c b/dlls/gdiplus/tests/font.c index 29d4ad5e04f..2b5cf0982e7 100644 --- a/dlls/gdiplus/tests/font.c +++ b/dlls/gdiplus/tests/font.c @@ -21,7 +21,7 @@ #include -#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); diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index b773d6370ff..2de456cb0df 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -22,9 +22,8 @@ #include #include -#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, diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 9a421534916..6d929b02685 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -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 diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 18e159b6c71..9f5730ebbdf 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -26,7 +26,7 @@ #include #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); diff --git a/dlls/gdiplus/tests/matrix.c b/dlls/gdiplus/tests/matrix.c index 379a8fac665..83b57ef7e2d 100644 --- a/dlls/gdiplus/tests/matrix.c +++ b/dlls/gdiplus/tests/matrix.c @@ -20,8 +20,7 @@ #include -#include "windows.h" -#include +#include "objbase.h" #include "gdiplus.h" #include "wine/test.h" diff --git a/dlls/gdiplus/tests/metafile.c b/dlls/gdiplus/tests/metafile.c index 3366f0eabb7..aa39351e8cf 100644 --- a/dlls/gdiplus/tests/metafile.c +++ b/dlls/gdiplus/tests/metafile.c @@ -18,8 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "windows.h" -#include +#include "objbase.h" #include "gdiplus.h" #include "wine/test.h" diff --git a/dlls/gdiplus/tests/pathiterator.c b/dlls/gdiplus/tests/pathiterator.c index 17cd4635f78..e606be3d87a 100644 --- a/dlls/gdiplus/tests/pathiterator.c +++ b/dlls/gdiplus/tests/pathiterator.c @@ -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" diff --git a/dlls/gdiplus/tests/pen.c b/dlls/gdiplus/tests/pen.c index b742118be37..90d57d6ae40 100644 --- a/dlls/gdiplus/tests/pen.c +++ b/dlls/gdiplus/tests/pen.c @@ -20,7 +20,7 @@ #include -#include "windows.h" +#include "objbase.h" #include "gdiplus.h" #include "wine/test.h" diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index dd2f76da1ff..c9da5730abb 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -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 +#include "objbase.h" +#include "gdiplus.h" +#include "wine/test.h" + #define RGNDATA_RECT 0x10000000 #define RGNDATA_PATH 0x10000001 #define RGNDATA_EMPTY_RECT 0x10000002 diff --git a/dlls/gdiplus/tests/stringformat.c b/dlls/gdiplus/tests/stringformat.c index 117e57bd243..f0fcff93d4d 100644 --- a/dlls/gdiplus/tests/stringformat.c +++ b/dlls/gdiplus/tests/stringformat.c @@ -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"