[GDI32_APITEST] Add a PCH.
[reactos.git] / modules / rostests / apitests / gdi32 / GetTextExtentExPoint.c
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
10 void Test_GetTextExtentExPoint()
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
51 START_TEST(GetTextExtentExPoint)
52 {
53 Test_GetTextExtentExPoint();
54 }
55