From c31fcaaae7082a1390cef632dd8fddfdd3c6df65 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Mon, 19 Apr 2010 19:45:10 +0000 Subject: [PATCH] [W32KNAPI] Patch by Jerome Gardou: more tests for NtGdiBitBlt svn path=/trunk/; revision=46948 --- .../apitests/w32knapi/ntgdi/NtGdiBitBlt.c | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c b/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c index d2821670a74..81bede314a5 100644 --- a/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c +++ b/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c @@ -30,6 +30,11 @@ Test_NtGdiBitBlt(PTESTINFO pti) TEST(hbmp1 != NULL); hOldBmp1 = SelectObject(hdc1, hbmp1); + TESTX(NtGdiGetPixel(hdc1, 0, 0) == 0x000000ff, "Pixel[0][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 0)); + TESTX(NtGdiGetPixel(hdc1, 0, 1) == 0x00ff0000, "Pixel[0][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 1)); + TESTX(NtGdiGetPixel(hdc1, 1, 0) == 0x0000ff00, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); + TESTX(NtGdiGetPixel(hdc1, 1, 1) == 0x00ffffff, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + hbmp2 = NtGdiCreateBitmap(2, 2, 1, 32, (LPBYTE)bytes2 ); TEST(hbmp2 != NULL); hOldBmp2 = SelectObject(hdc2, hbmp2); @@ -68,6 +73,8 @@ Test_NtGdiBitBlt(PTESTINFO pti) TESTX(NtGdiGetPixel(hdc2, 1, 0) == 0x00000000, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); TESTX(NtGdiGetPixel(hdc2, 1, 1) == 0x00000000, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + NtGdiSetPixel(hdc2, 0, 0, 0x00000000); + bRet = NtGdiBitBlt(hdc2, 2, 2, -2, -2, hdc1, 2, 2, SRCCOPY, 0, 0); TEST(bRet == TRUE); TEST(GetLastError() == ERROR_SUCCESS); @@ -76,6 +83,19 @@ Test_NtGdiBitBlt(PTESTINFO pti) TESTX(NtGdiGetPixel(hdc2, 1, 0) == 0x0000ff00, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); TESTX(NtGdiGetPixel(hdc2, 1, 1) == 0x00ffffff, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + NtGdiSetPixel(hdc2, 0, 0, 0x00000000); + NtGdiSetPixel(hdc2, 1, 0, 0x00000000); + NtGdiSetPixel(hdc2, 0, 1, 0x00000000); + NtGdiSetPixel(hdc2, 1, 1, 0x00000000); + + bRet = NtGdiBitBlt(hdc2, 0, 0, 2, 2, hdc1, 0, 0, SRCCOPY, 0, 0); + TEST(bRet == TRUE); + TEST(GetLastError() == ERROR_SUCCESS); + TESTX(NtGdiGetPixel(hdc2, 0, 0) == 0x000000ff, "Pixel[0][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 0)); + TESTX(NtGdiGetPixel(hdc2, 0, 1) == 0x00ff0000, "Pixel[0][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 0, 1)); + TESTX(NtGdiGetPixel(hdc2, 1, 0) == 0x0000ff00, "Pixel[1][0] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 0)); + TESTX(NtGdiGetPixel(hdc2, 1, 1) == 0x00ffffff, "Pixel[1][1] 0x%08x\n", (UINT)NtGdiGetPixel(hdc2, 1, 1)); + SelectObject(hdc2, hOldBmp2); SelectObject(hdc1, hOldBmp1); -- 2.17.1