ReactOS 0.4.15-dev-8245-gd24675b
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;
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
void Test_GetTextExtentExPoint()
#define ok_err(error)
Definition: atltest.h:124
#define START_TEST(x)
Definition: atltest.h:75
#define ok_int(expression, result)
Definition: atltest.h:134
#define NULL
Definition: types.h:112
#define SetLastError(x)
Definition: compat.h:752
unsigned int BOOL
Definition: ntddk_ex.h:94
#define printf
Definition: freeldr.h:97
GLsizeiptr size
Definition: glext.h:5919
GLuint64EXT * result
Definition: glext.h:11304
#define L(x)
Definition: ntvdm.h:50
int32_t INT
Definition: typedefs.h:58
#define GetTextExtentExPoint
Definition: wingdi.h:4471
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)
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)
HDC WINAPI GetDC(_In_opt_ HWND)