From 97290943183156ceddc940200bb83d6cbff86a7b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 4 Apr 2015 14:51:20 +0000 Subject: [PATCH] [GDI32_APITEST] Fix some broken tests or disable them. svn path=/trunk/; revision=67046 --- rostests/apitests/gdi32/GetClipBox.c | 2 +- rostests/apitests/gdi32/GetRandomRgn.c | 17 ++++++++++++----- rostests/apitests/gdi32/OffsetClipRgn.c | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/rostests/apitests/gdi32/GetClipBox.c b/rostests/apitests/gdi32/GetClipBox.c index d0e1a336770..3ee3c252e2f 100644 --- a/rostests/apitests/gdi32/GetClipBox.c +++ b/rostests/apitests/gdi32/GetClipBox.c @@ -40,7 +40,7 @@ void Test_GetClipBox() SetLastError(ERROR_SUCCESS); ret = GetClipBox((HDC)0x12345, &rect); ok(ret == ERROR, "Expected ERROR, got %d\n", ret); - ok(GetLastError() == 0, "Expected 0, got %ld\n", GetLastError()); + ok((GetLastError() == 0) || (GetLastError() == ERROR_INVALID_HANDLE), "Expected 0, got %ld\n", GetLastError()); //ret = GetClipBox(hdc, &rect); //ok_int(ret, SIMPLEREGION); diff --git a/rostests/apitests/gdi32/GetRandomRgn.c b/rostests/apitests/gdi32/GetRandomRgn.c index e2f4d74e5cc..5c822793e8b 100644 --- a/rostests/apitests/gdi32/GetRandomRgn.c +++ b/rostests/apitests/gdi32/GetRandomRgn.c @@ -74,12 +74,12 @@ void Test_GetRandomRgn_Params() ret = GetRandomRgn(hdc, hrgn, 0); ok_int(ret, 0); ok_long(GetLastError(), 0xbadbad00); - +#if 0 // this is vista+ SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 5); ok_int(ret, 1); ok_long(GetLastError(), 0xbadbad00); - +#endif SetLastError(0xbadbad00); ret = GetRandomRgn(hdc, hrgn, 6); ok_int(ret, 0); @@ -240,10 +240,12 @@ void Test_GetRandomRgn_SYSRGN() ok_int(ret, 1); GetRgnBox(hrgn1, &rect); DPtoLP(ghdcWindow, (LPPOINT)&rect, 2); +#if 0 // FIXME: this needs calculation ok_long(rect.left, 104); ok_long(rect.top, 124); ok_long(rect.right, 209); ok_long(rect.bottom, 196); +#endif MoveWindow(ghwnd, 200, 400, 200, 200, 0); @@ -251,11 +253,12 @@ void Test_GetRandomRgn_SYSRGN() ok_int(ret, 1); GetRgnBox(hrgn1, &rect2); DPtoLP(ghdcWindow, (LPPOINT)&rect2, 2); +#if 0 // FIXME: this needs calculation ok_long(rect2.left, rect.left + 100); ok_long(rect2.top, rect.top + 300); ok_long(rect2.right, rect.right + 200 - 13); ok_long(rect2.bottom, rect.bottom + 400); - +#endif DeleteObject(hrgn1); DeleteDC(hdc); @@ -269,6 +272,8 @@ void Test_GetRandomRgn_RGN5() INT ret; RECT rect, rect2; HBITMAP hbmp; + DBG_UNREFERENCED_LOCAL_VARIABLE(hrgn2); + DBG_UNREFERENCED_LOCAL_VARIABLE(rect2); hrgn1 = CreateRectRgn(11, 17, 23, 42); if (!hrgn1) @@ -283,7 +288,7 @@ void Test_GetRandomRgn_RGN5() printf("Coun't create a dc\n"); return; } - +#if 0 // this is vista+ ret = GetRandomRgn(hdc, hrgn1, RGN5); ok_int(ret, 1); GetRgnBox(hrgn1, &rect); @@ -302,6 +307,7 @@ void Test_GetRandomRgn_RGN5() ok_long(rect.top, 0); ok_long(rect.right, 1); ok_long(rect.bottom, 1); +#endif hbmp = CreateCompatibleBitmap(hdc, 4, 7); SelectObject(hdc, hbmp); @@ -314,6 +320,7 @@ void Test_GetRandomRgn_RGN5() ok_long(rect.bottom, 7); DeleteObject(hbmp); +#if 0 // this is vista+ MoveWindow(ghwnd, 100, 100, 100, 100, 0); ret = GetRandomRgn(ghdcWindow, hrgn1, RGN5); ok_int(ret, 1); @@ -334,7 +341,7 @@ void Test_GetRandomRgn_RGN5() ok_long(rect2.top, rect.top + 300); ok_long(rect2.right, rect.right + 200 - 13); ok_long(rect2.bottom, rect.bottom + 400); - +#endif DeleteObject(hrgn1); DeleteDC(hdc); diff --git a/rostests/apitests/gdi32/OffsetClipRgn.c b/rostests/apitests/gdi32/OffsetClipRgn.c index 91925034b47..a40265bf6cc 100644 --- a/rostests/apitests/gdi32/OffsetClipRgn.c +++ b/rostests/apitests/gdi32/OffsetClipRgn.c @@ -30,7 +30,7 @@ void Test_OffsetClipRgn() /* Test invalid DC */ SetLastError(0x12345); ok_int(OffsetClipRgn((HDC)(ULONG_PTR)0x12345, 0, 0), ERROR); - ok_int(GetLastError(), 0x12345); + ok((GetLastError() == 0x12345) || (GetLastError() == ERROR_INVALID_HANDLE), "Expected 0x12345 or ERROR_INVALID_HANDLE, got %ld\n", GetLastError()); SetLastError(0x12345); /* Test without a clip region set */ -- 2.17.1