Author: tkreuzer
Date: Mon Apr 30 14:44:18 2007
New Revision: 26588
URL:
http://svn.reactos.org/svn/reactos?rev=26588&view=rev
Log:
- Add Alex' test for GetObject (word alignment check)
- change TEST macro a little for better output
Modified:
trunk/rostests/win32/gdi32/gditest.h
trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c
trunk/rostests/win32/gdi32/tests/CreatePen.c
trunk/rostests/win32/gdi32/tests/GetObject.c
trunk/rostests/win32/gdi32/tests/GetStockObject.c
trunk/rostests/win32/gdi32/tests/SelectObject.c
trunk/rostests/win32/gdi32/tests/SetDCPenColor.c
trunk/rostests/win32/gdi32/tests/SetSysColors.c
Modified: trunk/rostests/win32/gdi32/gditest.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/gditest.h?rev…
==============================================================================
--- trunk/rostests/win32/gdi32/gditest.h (original)
+++ trunk/rostests/win32/gdi32/gditest.h Mon Apr 30 14:44:18 2007
@@ -16,7 +16,7 @@
(*passed)++;\
} else {\
(*failed)++;\
- printf("Test failed in file %s line %d\n", __FILE__, __LINE__);\
+ printf("Test failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
};
#define GDI_HANDLE_INDEX_MASK 0x00003fff // (GDI_HANDLE_COUNT - 1)
Modified: trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/CreateC…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c (original)
+++ trunk/rostests/win32/gdi32/tests/CreateCompatibleDC.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "CreateCompatibleDC.c"
+
#include "..\gditest.h"
BOOL Test_CreateCompatibleDC(INT* passed, INT* failed)
Modified: trunk/rostests/win32/gdi32/tests/CreatePen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/CreateP…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/CreatePen.c (original)
+++ trunk/rostests/win32/gdi32/tests/CreatePen.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "CreatePen.c"
+
#include "..\gditest.h"
BOOL
Modified: trunk/rostests/win32/gdi32/tests/GetObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/GetObje…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/GetObject.c (original)
+++ trunk/rostests/win32/gdi32/tests/GetObject.c Mon Apr 30 14:44:18 2007
@@ -1,8 +1,18 @@
+#line 1 "GetObject.c"
+
#include "..\gditest.h"
BOOL
Test_General(INT* passed, INT* failed)
{
+ struct
+ {
+ LOGBRUSH logbrush;
+ BYTE additional[5];
+ } TestStruct;
+ PLOGBRUSH plogbrush;
+ HBRUSH hBrush;
+
/* Test null pointer and invalid handles */
SetLastError(ERROR_SUCCESS);
TEST(GetObjectA(0, 0, NULL) == 0);
@@ -40,6 +50,15 @@
SetLastError(ERROR_SUCCESS);
TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
TEST(GetLastError() == ERROR_INVALID_HANDLE);
+
+ /* Test need of alignment */
+ hBrush = GetStockObject(WHITE_BRUSH);
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0);
return TRUE;
}
@@ -383,7 +402,7 @@
TEST(GetLastError() == ERROR_INVALID_HANDLE);
DeleteObject(hRgn);
- Test_Font(passed, failed);
+// Test_Font(passed, failed);
Test_Colorspace(passed, failed);
Test_General(passed, failed);
Test_Bitmap(passed, failed);
@@ -391,7 +410,7 @@
Test_Palette(passed, failed);
Test_Brush(passed, failed);
Test_Pen(passed, failed);
-// Test_ExtPpen(passed, failed); // not implemented yet in ROS
+// Test_ExtPen(passed, failed); // not implemented yet in ROS
Test_MetaDC(passed, failed);
return TRUE;
Modified: trunk/rostests/win32/gdi32/tests/GetStockObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/GetStoc…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/GetStockObject.c (original)
+++ trunk/rostests/win32/gdi32/tests/GetStockObject.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "GetStockObject.c"
+
#include "..\gditest.h"
BOOL Test_GetStockObject(INT* passed, INT* failed)
Modified: trunk/rostests/win32/gdi32/tests/SelectObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SelectO…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/SelectObject.c (original)
+++ trunk/rostests/win32/gdi32/tests/SelectObject.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "SelectObject.c"
+
#include "..\gditest.h"
BOOL Test_SelectObject(INT* passed, INT* failed)
Modified: trunk/rostests/win32/gdi32/tests/SetDCPenColor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SetDCPe…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/SetDCPenColor.c (original)
+++ trunk/rostests/win32/gdi32/tests/SetDCPenColor.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "SetDCPenColor.c"
+
#include "..\gditest.h"
BOOL Test_SetDCPenColor(INT* passed, INT* failed)
Modified: trunk/rostests/win32/gdi32/tests/SetSysColors.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/gdi32/tests/SetSysC…
==============================================================================
--- trunk/rostests/win32/gdi32/tests/SetSysColors.c (original)
+++ trunk/rostests/win32/gdi32/tests/SetSysColors.c Mon Apr 30 14:44:18 2007
@@ -1,3 +1,5 @@
+#line 1 "SetSysColors.c"
+
#include "..\gditest.h"
#define NUM_SYSCOLORS 31