31#define MODIFIED(rect) (rect.left == 10 && rect.right != 100 && rect.top == 10 && rect.bottom != 100)
32#define EMPTY(rect) (rect.left == rect.right && rect.bottom == rect.top)
40 static CHAR text[] =
"Example text for testing DrawText in "
42 static WCHAR textW[] = {
'W',
'i',
'd',
'e',
' ',
'c',
'h',
'a',
'r',
' ',
43 's',
't',
'r',
'i',
'n',
'g',
'\0'};
44 static CHAR emptystring[] =
"";
46 static CHAR wordbreak_text[] =
"line1 line2";
47 static WCHAR wordbreak_textW[] = {
'l',
'i',
'n',
'e',
'1',
' ',
'l',
'i',
'n',
'e',
'2',0};
48 static char tabstring[] =
"one\ttwo";
49 INT textlen, textheight, heightcheck;
57 0, 0, 200, 200, 0, 0, 0,
NULL);
65 memset(&lf, 0,
sizeof(lf));
77 ok(
hFont != 0,
"CreateFontIndirectA error %u\n",
86 trace(
"MM_HIENGLISH rect.bottom %d\n",
rect.bottom);
87 ok(
rect.bottom < 0,
"In MM_HIENGLISH, DrawText with "
88 "DT_CALCRECT should return a negative rectangle bottom. "
89 "(bot=%d)\n",
rect.bottom);
101 ok(
hFont != 0,
"CreateFontIndirectA error %u\n",
110 trace(
"MM_TEXT rect.bottom %d\n",
rect.bottom);
111 ok(
rect.bottom > 0,
"In MM_TEXT, DrawText with DT_CALCRECT "
112 "should return a positive rectangle bottom. (bot=%d)\n",
121 ok(textheight==0,
"Got textheight from DrawTextExA\n");
128 ok(textheight==0,
"Got textheight from DrawTextA\n");
129 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
135 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
140 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
141 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
150 win_skip(
"XP conformity failed, skipping XP tests. Probably winNT\n");
154 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
160 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
161 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
168 ok(textheight==0,
"Got textheight from DrawTextExA\n");
175 ok(textheight==0,
"Got textheight from DrawTextA\n");
176 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
185 ok(textheight==0,
"Got textheight from DrawTextExA\n");
192 ok(textheight==0,
"Got textheight from DrawTextA\n");
193 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
200 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
206 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
207 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
215 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
222 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
223 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
230 ok(textheight==0,
"Got textheight from DrawTextExA\n");
237 ok(textheight==0,
"Got textheight from DrawTextA\n");
238 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
243 ok(textheight==0,
"Got textheight from DrawTextA\n");
246 ok(textheight==0,
"Got textheight from DrawTextExA\n");
247 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
250 ok(textheight==0,
"Got textheight from DrawTextA\n");
253 ok(textheight==0,
"Got textheight from DrawTextExA\n");
254 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
257 ok(textheight==0,
"Got textheight from DrawTextA\n");
260 ok(textheight==0,
"Got textheight from DrawTextExA\n");
261 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
263 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
265 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
266 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
269 ok(textheight!=0,
"Failed to get textheight from DrawTextA\n");
272 ok(textheight!=0,
"Failed to get textheight from DrawTextExA\n");
273 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
275 ok(textheight==0,
"Got textheight from DrawTextA\n");
277 ok(textheight==0,
"Got textheight from DrawTextA\n");
278 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
283 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
287 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
294 ok(textheight == 1,
"Expect returned height:1 got:%d\n", textheight);
300 ok(textheight==0,
"Got textheight from DrawTextExA\n");
304 ok(textheight==0,
"Got textheight from DrawTextExA\n");
308 ok(textheight==0,
"Got textheight from DrawTextExA\n");
312 ok(textheight==0,
"Got textheight from DrawTextExA\n");
316 ok(textheight==0,
"Got textheight from DrawTextExA\n");
325 textlen =
rect.right;
343 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
349 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
350 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
355 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
360 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
361 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
370 win_skip(
"XP conformity failed, skipping XP tests. Probably win 2000\n");
374 ok(textheight==0,
"Got textheight from DrawTextExW\n");
381 ok(textheight==0,
"Got textheight from DrawTextW\n");
382 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
390 ok(textheight==0,
"Got textheight from DrawTextExW\n");
396 ok(textheight==0,
"Got textheight from DrawTextW\n");
397 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
406 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
412 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
413 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
419 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
425 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
426 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
434 ok(textheight==0,
"Got textheight from DrawTextExW\n");
440 ok(textheight==0,
"Got textheight from DrawTextW\n");
441 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
449 ok(textheight==0,
"Got textheight from DrawTextExW\n");
456 ok(textheight==0,
"Got textheight from DrawTextW\n");
457 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
461 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
463 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
464 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
466 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
468 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
469 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
472 ok(textheight==0,
"Got textheight from DrawTextW\n");
475 ok(textheight==0,
"Got textheight from DrawTextExW\n");
476 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
478 ok(textheight!=0,
"Failed to get textheight from DrawTextW\n");
480 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
481 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
485 ok(textheight==0,
"Got textheight from DrawTextW\n");
487 ok(textheight==0,
"Got textheight from DrawTextExW\n");
488 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
490 ok(textheight==0,
"Got textheight from DrawTextW\n");
492 ok(textheight==0,
"Got textheight from DrawTextW\n");
493 ok(textheight == heightcheck,
"DrawTextEx and DrawText differ in return\n");
499 ok(textheight!=0,
"Failed to get textheight from DrawTextExW\n");
504 ok(textheight==0,
"Got textheight from DrawTextExW\n");
509 ok(textheight==0,
"Got textheight from DrawTextExW\n");
513 ok(textheight==0,
"Got textheight from DrawTextExW\n");
519 ok(textheight==0,
"Got textheight from DrawTextExW\n");
528 ok(0 ==
rect.left,
"expected 0, got %d\n",
rect.left);
529 ok(0 ==
rect.right,
"expected 0, got %d\n",
rect.right);
530 ok(0 ==
rect.top,
"expected 0, got %d\n",
rect.top);
531 ok(
rect.bottom,
"rect.bottom should not be 0\n");
537 win_skip(
"DrawTextW not implemented\n" );
542 ok(0 ==
rect.left,
"expected 0, got %d\n",
rect.left);
543 ok(0 ==
rect.right,
"expected 0, got %d\n",
rect.right);
544 ok(0 ==
rect.top,
"expected 0, got %d\n",
rect.top);
545 ok(
rect.bottom,
"rect.bottom should not be 0\n");
552 ok(textheight == heightcheck * 2,
"Got unexpected textheight %d, expected %d.\n",
553 textheight, heightcheck * 2);
556 ok(textheight >= heightcheck * 6,
"Got unexpected textheight %d, expected at least %d.\n",
557 textheight, heightcheck * 6);
563 ok(textheight == heightcheck * 2,
"Got unexpected textheight %d, expected %d.\n",
564 textheight, heightcheck * 2);
567 ok(textheight >= heightcheck * 6,
"Got unexpected textheight %d, expected at least %d.\n",
568 textheight, heightcheck * 6);
573 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
576 memset(&dtp, 0,
sizeof(dtp));
579 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
583 memset(&dtp, 0,
sizeof(dtp));
586 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
592 memset(&dtp, 0,
sizeof(dtp));
596 ok(textheight >= heightcheck,
"Got unexpected textheight %d\n", textheight);
621 if((strout[
j]=
str[
i])==
'\t') {
628#define TABTEST( tabval, tabcount, string, _exp) \
629{ int i; char strdisp[64];\
630 for(i=0;i<8;i++) tabs[i]=(i+1)*(tabval); \
631 extent = GetTabbedTextExtentA( hdc, string, strlen( string), (tabcount), tabs); \
632 strfmt( string, strdisp); \
634 ok( extent == _exp, "Test case \"%s\". Text extent is 0x%x, expected 0x%x tab %d tabcount %d\n", \
635 strdisp, extent, _exp, tabval, tabcount); \
650 0, 0, 200, 200, 0, 0, 0,
NULL);
659 ok(
extent == 0,
"GetTabbedTextExtentA returned non-zero on nCount == 0\n");
667 for(
t=-1;
t<=1;
t++) {
671 for( tabcount = 1; tabcount <= 8; tabcount +=7) {
685 for(
t=-1;
t<=1;
t++) {
689 for( tabcount = 1; tabcount <= 8; tabcount +=7) {
709 static const char text[] =
"Sample text string";
715 0, 0, 200, 200, 0, 0, 0,
NULL);
749 static const WCHAR helloWorldW[] = {
'H',
'e',
'l',
'l',
'o',
' ',
'W',
'o',
'r',
'l',
'd',0};
751 static const char helloWorld[] =
"Hello World";
829 for (
i = 0;
i < 0x100;
i++)
833 ok(
ret,
"%02x: returns FALSE\n",
i );
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
static const char * wine_dbgstr_rect(const RECT *prc)
#define ERROR_CALL_NOT_IMPLEMENTED
#define MultiByteToWideChar
static const WCHAR emptystringW[]
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
int align(int length, int align)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static const WCHAR emptyW[]
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
static struct test_info tests[]
static const WCHAR textW[]
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static void strfmt(const char *str, char *strout)
static void test_DrawTextCalcRect(void)
static void test_TabbedText(void)
static void test_DrawState(void)
#define TABTEST(tabval, tabcount, string, _exp)
static void test_CharToOem_OemToChar(void)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
_Out_opt_ int _Out_opt_ int * cy
CHAR lfFaceName[LF_FACESIZE]
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
DWORD WINAPI GetLastError(void)
int WINAPI SetMapMode(_In_ HDC, _In_ int)
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define CLIP_DEFAULT_PRECIS
BOOL WINAPI GetTextMetricsA(_In_ HDC, _Out_ LPTEXTMETRICA)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
DWORD WINAPI GetTabbedTextExtentA(_In_ HDC hdc, _In_reads_(chCount) LPCSTR lpString, _In_ int chCount, _In_ int nTabPositions, _In_reads_opt_(nTabPositions) CONST INT *lpnTabStopPositions)
#define DT_EXTERNALLEADING
BOOL WINAPI CharToOemBuffA(_In_ LPCSTR lpszSrc, _Out_writes_(cchDstLength) LPSTR lpszDst, _In_ DWORD cchDstLength)
BOOL WINAPI CharToOemA(_In_ LPCSTR pSrc, _Out_writes_(_Inexpressible_(strlen(pSrc)+1)) LPSTR pDst)
BOOL WINAPI OemToCharA(_In_ LPCSTR pSrc, _Out_writes_(_Inexpressible_(strlen(pSrc)+1)) LPSTR pDst)
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI OemToCharW(_In_ LPCSTR pSrc, _Out_writes_(_Inexpressible_(strlen(pSrc)+1)) LPWSTR pDst)
BOOL WINAPI OemToCharBuffW(_In_ LPCSTR lpszSrc, _Out_writes_(cchDstLength) LPWSTR lpszDst, _In_ DWORD cchDstLength)
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
BOOL WINAPI DrawStateA(_In_ HDC, _In_opt_ HBRUSH, _In_opt_ DRAWSTATEPROC, _In_ LPARAM, _In_ WPARAM, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
int WINAPI DrawTextExA(_In_ HDC hdc, _Inout_updates_opt_(cchText) LPSTR lpchText, _In_ int cchText, _Inout_ LPRECT lprc, _In_ UINT format, _In_opt_ LPDRAWTEXTPARAMS lpdtp)
int WINAPI DrawTextExW(_In_ HDC hdc, _Inout_updates_opt_(cchText) LPWSTR lpchText, _In_ int cchText, _Inout_ LPRECT lprc, _In_ UINT format, _In_opt_ LPDRAWTEXTPARAMS lpdtp)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI OemToCharBuffA(_In_ LPCSTR lpszSrc, _Out_writes_(cchDstLength) LPSTR lpszDst, _In_ DWORD cchDstLength)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI CharToOemW(_In_ LPCWSTR pSrc, _Out_writes_(_Inexpressible_(strlen(pSrc)+1)) LPSTR pDst)
BOOL WINAPI CharToOemBuffW(_In_ LPCWSTR lpszSrc, _Out_writes_(cchDstLength) LPSTR lpszDst, _In_ DWORD cchDstLength)