ReactOS  0.4.14-dev-57-g333b8f1
GetTextExtentExPoint.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: Test for GetTextExtentExPoint
5  * PROGRAMMERS: Timo Kreuzer
6  * Katayama Hirofumi MZ
7  */
8 
9 #include "precomp.h"
10 
12 {
13  INT nFit;
14  SIZE size;
15  BOOL result;
16 
17  SetLastError(0);
18 
19  result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size);
20  ok_int(result, 1);
21  ok_int(nFit, 4);
22  ok_err(0);
23  printf("nFit = %d\n", nFit);
24 
25  result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
26  ok_int(result, 1);
27  ok_int(nFit, 0);
28  ok_err(0);
29  printf("nFit = %d\n", nFit);
30 
31  result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
32  ok_int(result, 1);
33  ok_int(nFit, 0);
34  ok_err(0);
35 
36  result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
37  ok_int(result, 1);
38  ok_int(nFit, 4);
39  ok_err(0);
40 
41  result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
42  ok_int(result, 0);
43  ok_err(87);
44 
45  result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size);
46  ok_int(result, 1);
47 
48  result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size);
49  ok_int(result, 0);
50 }
51 
53 {
55 }
56 
HDC WINAPI GetDC(_In_opt_ HWND)
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI GetTextExtentExPointW(_In_ HDC hdc, _In_reads_(cchString) LPCWSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define ok_int(expression, result)
Definition: atltest.h:134
GLsizeiptr size
Definition: glext.h:5919
#define SetLastError(x)
Definition: compat.h:409
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI GetTextExtentExPointA(_In_ HDC hdc, _In_reads_(cchString) LPCSTR lpszString, _In_ int cchString, _In_ int nMaxExtent, _Out_opt_ LPINT lpnFit, _Out_writes_to_opt_(cchString, *lpnFit) LPINT lpnDx, _Out_ LPSIZE lpSize)
#define ok_err(error)
Definition: atltest.h:124
START_TEST(GetTextExtentExPoint)
void Test_GetTextExtentExPoint()
#define GetTextExtentExPoint
Definition: wingdi.h:4466
GLuint64EXT * result
Definition: glext.h:11304
#define printf
Definition: config.h:203