Author: tkreuzer
Date: Fri Nov 30 03:09:28 2007
New Revision: 30904
URL:
http://svn.reactos.org/svn/reactos?rev=30904&view=rev
Log:
- another test for NtGdiBitBlt
- Add tests for NtGdiSelectBitmap, NtGdiSelectBrush, NtGdiSelectFont and NtGdiSelectPen
Added:
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBitmap.c (with props)
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBrush.c (with props)
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectFont.c (with props)
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectPen.c (with props)
Modified:
trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c
trunk/rostests/apitests/w32knapi/testlist.c
Modified: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c (original)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiBitBlt.c Fri Nov 30 03:09:28 2007
@@ -3,6 +3,12 @@
Test_NtGdiBitBlt(PTESTINFO pti)
{
BOOL bRet;
+
+ /* Test NULL dc */
+ SetLastError(ERROR_SUCCESS);
+ bRet = NtGdiBitBlt((HDC)0, 0, 0, 10, 10, (HDC)0, 10, 10, SRCCOPY, 0, 0);
+ TEST(bRet == FALSE);
+ TEST(GetLastError() == ERROR_SUCCESS);
/* Test invalid dc */
SetLastError(ERROR_SUCCESS);
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBitmap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBitmap.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBitmap.c Fri Nov 30 03:09:28 2007
@@ -1,0 +1,49 @@
+INT
+Test_NtGdiSelectBitmap(PTESTINFO pti)
+{
+ HDC hDC;
+ HBITMAP hBmp, hOldBmp;
+
+ hDC = CreateCompatibleDC(GetDC(NULL));
+ ASSERT(hDC);
+
+ hBmp = CreateBitmap(2,2,1,1,NULL);
+
+ /* Test NULL DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldBmp = NtGdiSelectBitmap(NULL, hBmp);
+ TEST(hOldBmp == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldBmp = NtGdiSelectBitmap((HDC)((ULONG_PTR)hDC & 0x0000ffff), hBmp);
+ TEST(hOldBmp == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL bitmap */
+ SetLastError(ERROR_SUCCESS);
+ hOldBmp = NtGdiSelectBitmap(hDC, NULL);
+ TEST(hOldBmp == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL bitmap */
+ SetLastError(ERROR_SUCCESS);
+ hOldBmp = NtGdiSelectBitmap(hDC, (HBITMAP)((ULONG_PTR)hBmp & 0x0000ffff));
+ TEST(hOldBmp == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid bitmap */
+ SetLastError(ERROR_SUCCESS);
+ hOldBmp = NtGdiSelectBitmap(hDC, hBmp);
+ TEST(hOldBmp != NULL);
+ hOldBmp = NtGdiSelectBitmap(hDC, hOldBmp);
+ TEST(hOldBmp == hBmp);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ DeleteObject(hBmp);
+ DeleteDC(hDC);
+
+ return APISTATUS_NORMAL;
+}
+
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBitmap.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBrush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBrush.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBrush.c Fri Nov 30 03:09:28 2007
@@ -1,0 +1,47 @@
+INT
+Test_NtGdiSelectBrush(PTESTINFO pti)
+{
+ HDC hDC;
+ HBRUSH hBrush, hOldBrush;
+
+ hDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
+
+ hBrush = GetStockObject(GRAY_BRUSH);
+
+ /* Test NULL DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldBrush = NtGdiSelectBrush(NULL, hBrush);
+ TEST(hOldBrush == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldBrush = NtGdiSelectBrush((HDC)((ULONG_PTR)hDC & 0x0000ffff), hBrush);
+ TEST(hOldBrush == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL brush */
+ SetLastError(ERROR_SUCCESS);
+ hOldBrush = NtGdiSelectBrush(hDC, NULL);
+ TEST(hOldBrush == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid brush */
+ SetLastError(ERROR_SUCCESS);
+ hOldBrush = NtGdiSelectBrush(hDC, (HBRUSH)((ULONG_PTR)hBrush & 0x0000ffff));
+ TEST(hOldBrush == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ SetLastError(ERROR_SUCCESS);
+ hOldBrush = NtGdiSelectBrush(hDC, hBrush);
+ TEST(hOldBrush != NULL);
+ hOldBrush = NtGdiSelectBrush(hDC, hOldBrush);
+ TEST(hOldBrush == hBrush);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+
+ DeleteDC(hDC);
+
+ return APISTATUS_NORMAL;
+}
+
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectBrush.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectFont.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectFont.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectFont.c Fri Nov 30 03:09:28 2007
@@ -1,0 +1,47 @@
+INT
+Test_NtGdiSelectFont(PTESTINFO pti)
+{
+ HDC hDC;
+ HFONT hFont, hOldFont;
+
+ hDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
+
+ hFont = GetStockObject(DEFAULT_GUI_FONT);
+
+ /* Test NULL DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldFont = NtGdiSelectFont(NULL, hFont);
+ TEST(hOldFont == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldFont = NtGdiSelectFont((HDC)((ULONG_PTR)hDC & 0x0000ffff), hFont);
+ TEST(hOldFont == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL font */
+ SetLastError(ERROR_SUCCESS);
+ hOldFont = NtGdiSelectFont(hDC, NULL);
+ TEST(hOldFont == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid font */
+ SetLastError(ERROR_SUCCESS);
+ hOldFont = NtGdiSelectFont(hDC, (HFONT)((ULONG_PTR)hFont & 0x0000ffff));
+ TEST(hOldFont == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ SetLastError(ERROR_SUCCESS);
+ hOldFont = NtGdiSelectFont(hDC, hFont);
+ TEST(hOldFont != NULL);
+ hOldFont = NtGdiSelectFont(hDC, hOldFont);
+ TEST(hOldFont == hFont);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+
+ DeleteDC(hDC);
+
+ return APISTATUS_NORMAL;
+}
+
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectFont.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectPen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntgdi/N…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectPen.c (added)
+++ trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectPen.c Fri Nov 30 03:09:28 2007
@@ -1,0 +1,46 @@
+INT
+Test_NtGdiSelectPen(PTESTINFO pti)
+{
+ HDC hDC;
+ HPEN hPen, hOldPen;
+
+ hDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);
+
+ hPen = GetStockObject(WHITE_PEN);
+
+ /* Test NULL DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldPen = NtGdiSelectPen(NULL, hPen);
+ TEST(hOldPen == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test invalid DC */
+ SetLastError(ERROR_SUCCESS);
+ hOldPen = NtGdiSelectPen((HDC)((ULONG_PTR)hDC & 0x0000ffff), hPen);
+ TEST(hOldPen == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL pen */
+ SetLastError(ERROR_SUCCESS);
+ hOldPen = NtGdiSelectPen(hDC, NULL);
+ TEST(hOldPen == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test NULL pen */
+ SetLastError(ERROR_SUCCESS);
+ hOldPen = NtGdiSelectPen(hDC, (HPEN)((ULONG_PTR)hPen & 0x0000ffff));
+ TEST(hOldPen == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ SetLastError(ERROR_SUCCESS);
+ hOldPen = NtGdiSelectPen(hDC, hPen);
+ TEST(hOldPen != NULL);
+ hOldPen = NtGdiSelectPen(hDC, hOldPen);
+ TEST(hOldPen == hPen);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+
+ DeleteDC(hDC);
+
+ return APISTATUS_NORMAL;
+}
Propchange: trunk/rostests/apitests/w32knapi/ntgdi/NtGdiSelectPen.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/w32knapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/testlis…
==============================================================================
--- trunk/rostests/apitests/w32knapi/testlist.c (original)
+++ trunk/rostests/apitests/w32knapi/testlist.c Fri Nov 30 03:09:28 2007
@@ -16,6 +16,10 @@
#include "ntgdi/NtGdiEnumFontOpen.c"
#include "ntgdi/NtGdiGetBitmapBits.c"
#include "ntgdi/NtGdiGetRandomRgn.c"
+#include "ntgdi/NtGdiSelectBitmap.c"
+#include "ntgdi/NtGdiSelectBrush.c"
+#include "ntgdi/NtGdiSelectFont.c"
+#include "ntgdi/NtGdiSelectPen.c"
#include "ntgdi/NtGdiSetBitmapBits.c"
//#include "ntgdi/NtGdiSTROBJ_vEnumStart.c"
#include "ntgdi/NtGdiGetDIBits.c"
@@ -46,6 +50,10 @@
{ L"NtGdiGetBitmapBits", Test_NtGdiGetBitmapBits },
{ L"NtGdiGetRandomRgn", Test_NtGdiGetRandomRgn },
{ L"NtGdiSetBitmapBits", Test_NtGdiSetBitmapBits },
+ { L"NtGdiSelectBitmap", Test_NtGdiSelectBitmap },
+ { L"NtGdiSelectBrush", Test_NtGdiSelectBrush },
+ { L"NtGdiSelectFont", Test_NtGdiSelectFont },
+ { L"NtGdiSelectPen", Test_NtGdiSelectPen },
// { L"NtGdiSTROBJ_vEnumStart", Test_NtGdiSTROBJ_vEnumStart },
{ L"NtGdiGetDIBitsInternal", Test_NtGdiGetDIBitsInternal },