Commit 57a8ccf4 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

gdiplus/tests: Enable compilation with long types.

parent eb39c4e4
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = gdiplus.dll
IMPORTS = gdiplus ole32 user32 gdi32
......
......@@ -28,7 +28,7 @@
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got);
}
#define expectf(expected, got) ok(fabs(expected - got) < 0.0001, "Expected %.2f, got %.2f\n", expected, got)
......
......@@ -28,10 +28,10 @@
#define expect(expected,got) expect_inline(__LINE__, expected, got)
static inline void expect_inline(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %d, got %d\n", expected, got);
ok_(__FILE__, line)(expected == got, "Expected %ld, got %ld\n", expected, got);
}
#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %d\n", (expected), (got))
#define expect_(expected, got, precision) ok(abs((expected) - (got)) <= (precision), "Expected %d, got %ld\n", (expected), (got))
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
#define expectf(expected, got) expectf_((expected), (got), 0.001)
......@@ -54,7 +54,7 @@ static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW
lstrcatW(pathW, filename);
file = CreateFileW(pathW, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n", wine_dbgstr_w(pathW), GetLastError());
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n", wine_dbgstr_w(pathW), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(resource), (LPCSTR)RT_RCDATA);
ok(res != 0, "couldn't find resource\n");
......@@ -68,7 +68,7 @@ static void create_testfontfile(const WCHAR *filename, int resource, WCHAR pathW
static void _delete_testfontfile(const WCHAR *filename, int line)
{
BOOL ret = DeleteFileW(filename);
ok_(__FILE__,line)(ret, "failed to delete file %s, error %d\n", wine_dbgstr_w(filename), GetLastError());
ok_(__FILE__,line)(ret, "failed to delete file %s, error %ld\n", wine_dbgstr_w(filename), GetLastError());
}
static void test_long_name(void)
......@@ -752,14 +752,14 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip);
trace("gdiplus:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
fm_gdip.font_height, fm_gdip.font_size);
gdi_get_font_metrics(&lf, &fm_gdi);
trace("gdi:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
fm_gdi.font_height, fm_gdi.font_size);
......@@ -768,10 +768,10 @@ static void test_font_metrics(void)
stat = GdipGetLogFontW(font, graphics, &lf);
expect(Ok, stat);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight);
gdi_get_font_metrics(&lf, &fm_gdi);
trace("gdi:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
fm_gdi.font_height, fm_gdi.font_size);
......@@ -793,14 +793,14 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip);
trace("gdiplus:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
fm_gdip.font_height, fm_gdip.font_size);
gdi_get_font_metrics(&lf, &fm_gdi);
trace("gdi:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
fm_gdi.font_height, fm_gdi.font_size);
......@@ -809,10 +809,10 @@ static void test_font_metrics(void)
stat = GdipGetLogFontW(font, graphics, &lf);
expect(Ok, stat);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight);
gdi_get_font_metrics(&lf, &fm_gdi);
trace("gdi:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
fm_gdi.font_height, fm_gdi.font_size);
......@@ -831,17 +831,17 @@ static void test_font_metrics(void)
gdip_get_font_metrics(font, &fm_gdip);
trace("gdiplus:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdip.em_height, fm_gdip.line_spacing, fm_gdip.ascent, fm_gdip.descent,
fm_gdip.font_height, fm_gdip.font_size);
stat = GdipGetLogFontW(font, graphics, &lf);
expect(Ok, stat);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %d\n", lf.lfHeight);
ok(lf.lfHeight < 0, "lf.lfHeight should be negative, got %ld\n", lf.lfHeight);
gdi_get_font_metrics(&lf, &fm_gdi);
trace("gdi:\n");
trace("%s,%d: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
trace("%s,%ld: EmHeight %u, LineSpacing %u, CellAscent %u, CellDescent %u, FontHeight %f, FontSize %f\n",
wine_dbgstr_w(lf.lfFaceName), lf.lfHeight,
fm_gdi.em_height, fm_gdi.line_spacing, fm_gdi.ascent, fm_gdi.descent,
fm_gdi.font_height, fm_gdi.font_size);
......
......@@ -3178,7 +3178,7 @@ static void test_GdipGetNearestColor(void)
todo_wine
ok(color == 0xffa8b8e8 ||
broken(color == 0xffa0b8e0), /* Win98/WinMe */
"Expected ffa8b8e8, got %.8x\n", color);
"Expected ffa8b8e8, got %.8lx\n", color);
GdipDeleteGraphics(graphics);
GdipDisposeImage((GpImage*)bitmap);
......@@ -3784,7 +3784,7 @@ static void test_GdipMeasureString(void)
height = units_to_pixels(font_size, td[i].unit, td[i].res_y);
if (td[i].unit != UnitDisplay)
height *= td[i].page_scale;
ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %d (%f), got %d\n",
ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %ld (%f), got %ld\n",
i, (LONG)(height + 0.5), height, lf.lfHeight);
height = font_size + 2.0 * font_size / 6.0;
......@@ -3865,7 +3865,7 @@ static void test_GdipMeasureString(void)
else
height = units_to_pixels(font_size, font_unit, td[i].res_y);
/*trace("%.1f font units = %f pixels with %.1f dpi, page_scale %.1f\n", font_size, height, td[i].res_y, td[i].page_scale);*/
ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %d (%f), got %d\n",
ok(-lf.lfHeight == (LONG)(height + 0.5), "%u: expected %ld (%f), got %ld\n",
i, (LONG)(height + 0.5), height, lf.lfHeight);
if (td[i].unit == UnitDisplay || td[i].unit == UnitPixel)
......@@ -3955,7 +3955,7 @@ static void test_GdipMeasureString(void)
lf.lfHeight = 0xdeadbeef;
status = GdipGetLogFontW(font, graphics, &lf);
expect(Ok, status);
ok(lf.lfHeight == -100, "%u: expected -100, got %d\n", i, lf.lfHeight);
ok(lf.lfHeight == -100, "%u: expected -100, got %ld\n", i, lf.lfHeight);
set_rect_empty(&rc);
set_rect_empty(&bounds);
......@@ -6421,7 +6421,7 @@ static DWORD* GetBitmapPixelBuffer(HDC hdc, HBITMAP hbmp, int width, int height)
bi.biClrImportant = 0;
lines = GetDIBits(hdc, hbmp, 0, height, buffer, (BITMAPINFO *)&bi, DIB_RGB_COLORS);
ok(lines == height, "Expected GetDIBits:%p,%d->%d,%d\n", buffer, height, lines, GetLastError());
ok(lines == height, "Expected GetDIBits:%p,%d->%d,%ld\n", buffer, height, lines, GetLastError());
return buffer;
}
......@@ -7204,7 +7204,7 @@ static void test_printer_dc(void)
rect.Width = pixel_per_unit_x;
rect.Height = pixel_per_unit_y;
match = check_rect_pixels(pixel, &rect, width, 0, &pt);
ok(match, "Expected pixel (%u, %u) to be %08x, got %08x\n",
ok(match, "Expected pixel (%u, %u) to be %08x, got %08lx\n",
pt.X, pt.Y, 0, pixel[pt.X + pt.Y * width]);
/* pixels at (1, 1) should all be 0x00ffffff */
......@@ -7213,7 +7213,7 @@ static void test_printer_dc(void)
rect.Width = pixel_per_unit_x;
rect.Height = pixel_per_unit_y;
match = check_rect_pixels(pixel, &rect, width, 0x00ffffff, &pt);
ok(match, "Expected pixel (%u, %u) to be %08x, got %08x\n",
ok(match, "Expected pixel (%u, %u) to be %08x, got %08lx\n",
pt.X, pt.Y, 0x00ffffff, pixel[pt.X + pt.Y * width]);
GdipFree(pixel);
......
......@@ -28,7 +28,7 @@
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got);
}
#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) <= (precision), "Expected %f, got %f\n", (expected), (got))
#define expectf(expected, got) expectf_((expected), (got), 0.001)
......@@ -64,14 +64,14 @@ static void check_record(int count, const char *desc, const struct emfplus_recor
todo_wine_if (expected->todo)
ok(expected->record_type == actual->record_type && (expected->flags == actual->flags ||
broken(expected->broken_flags == actual->flags)),
"%s.%i: Expected record type 0x%x, got 0x%x. Expected flags %#x, got %#x.\n", desc, count,
"%s.%i: Expected record type 0x%lx, got 0x%lx. Expected flags %#lx, got %#lx.\n", desc, count,
expected->record_type, actual->record_type, expected->flags, actual->flags);
}
else
{
todo_wine_if (expected->todo)
ok(expected->record_type == actual->record_type,
"%s.%i: Expected record type 0x%x, got 0x%x.\n", desc, count,
"%s.%i: Expected record type 0x%lx, got 0x%lx.\n", desc, count,
expected->record_type, actual->record_type);
}
}
......@@ -136,7 +136,7 @@ static int CALLBACK enum_emf_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETAR
const EmfPlusRecordHeader *record = (const EmfPlusRecordHeader*)&comment->Data[offset];
ok(record->Size == record->DataSize + sizeof(EmfPlusRecordHeader),
"%s: EMF+ record datasize %u and size %u mismatch\n", state->desc, record->DataSize, record->Size);
"%s: EMF+ record datasize %lu and size %lu mismatch\n", state->desc, record->DataSize, record->Size);
ok(offset + record->DataSize <= comment->cbData,
"%s: EMF+ record truncated\n", state->desc);
......@@ -196,7 +196,7 @@ static int CALLBACK enum_emf_proc(HDC hDC, HANDLETABLE *lpHTable, const ENHMETAR
}
else
{
ok(0, "%s: Unexpected EMF 0x%x record\n", state->desc, lpEMFR->iType);
ok(0, "%s: Unexpected EMF 0x%lx record\n", state->desc, lpEMFR->iType);
}
return 1;
......@@ -294,7 +294,7 @@ static BOOL CALLBACK play_metafile_proc(EmfPlusRecordType record_type, unsigned
todo_wine_if (state->expected[state->count].todo)
ok(state->expected[state->count].record_type == record_type,
"%s.%i: expected record type 0x%x, got 0x%x\n", state->desc, state->count,
"%s.%i: expected record type 0x%lx, got 0x%x\n", state->desc, state->count,
state->expected[state->count].record_type, record_type);
state->count++;
}
......@@ -3154,7 +3154,7 @@ static void test_unknownfontdecode(void)
lstrcatW(path, L"wine_testfont0.ttf");
file = CreateFileW(path, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %d\n",
ok(file != INVALID_HANDLE_VALUE, "file creation failed, at %s, error %ld\n",
wine_dbgstr_w(path), GetLastError());
res = FindResourceA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(testfont0_resnum),
......
......@@ -27,7 +27,7 @@
#define expect(expected,got) expect_(__LINE__, expected, got)
static inline void expect_(unsigned line, DWORD expected, DWORD got)
{
ok_(__FILE__, line)(expected == got, "Expected %.8d, got %.8d\n", expected, got);
ok_(__FILE__, line)(expected == got, "Expected %.8ld, got %.8ld\n", expected, got);
}
#define expectf(expected, got) ok(fabs(got - expected) < 0.1, "Expected %.2f, got %.2f\n", expected, got)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment