ReactOS  0.4.12-dev-918-g6c6e7b8
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  */
7 
8 #include "precomp.h"
9 
11 {
12  INT nFit;
13  SIZE size;
14  BOOL result;
15 
16  SetLastError(0);
17 
18  result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size);
19  TEST(result == 1);
20  TEST(nFit == 4);
21  TEST(GetLastError() == 0);
22  printf("nFit = %d\n", nFit);
23 
24  result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
25  TEST(result == 1);
26  TEST(nFit == 0);
27  TEST(GetLastError() == 0);
28  printf("nFit = %d\n", nFit);
29 
30  result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
31  TEST(result == 1);
32  TEST(nFit == 0);
33  TEST(GetLastError() == 0);
34 
35  result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
36  TEST(result == 1);
37  TEST(nFit == 4);
38  TEST(GetLastError() == 0);
39 
40  result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
41  TEST(result == 0);
42  TEST(GetLastError() == 87);
43 
44  result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size);
45  TEST(result == 1);
46 
47  result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size);
48  TEST(result == 0);
49 }
50 
52 {
54 }
55 
HDC WINAPI GetDC(_In_opt_ HWND)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
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
GLsizeiptr size
Definition: glext.h:5919
#define TEST(x)
Definition: precomp.h:20
#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)
START_TEST(GetTextExtentExPoint)
void Test_GetTextExtentExPoint()
#define GetTextExtentExPoint
Definition: wingdi.h:4449
GLuint64EXT * result
Definition: glext.h:11304
#define printf
Definition: config.h:203