Fix copy paste error in file header
[reactos.git] / 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 <stdio.h>
9 #include <wine/test.h>
10 #include <windows.h>
11
12 #define TEST(x) ok(x, #x)
13 #define RTEST(x) ok(x, #x)
14
15 void Test_GetTextExtentExPoint()
16 {
17 INT nFit;
18 SIZE size;
19 BOOL result;
20
21 SetLastError(0);
22
23 result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size);
24 TEST(result == 1);
25 TEST(nFit == 4);
26 TEST(GetLastError() == 0);
27 printf("nFit = %d\n", nFit);
28
29 result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
30 TEST(result == 1);
31 TEST(nFit == 0);
32 TEST(GetLastError() == 0);
33 printf("nFit = %d\n", nFit);
34
35 result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
36 TEST(result == 1);
37 TEST(nFit == 0);
38 TEST(GetLastError() == 0);
39
40 result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
41 TEST(result == 1);
42 TEST(nFit == 4);
43 TEST(GetLastError() == 0);
44
45 result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
46 TEST(result == 0);
47 TEST(GetLastError() == 87);
48
49 result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size);
50 TEST(result == 1);
51
52 result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size);
53 TEST(result == 0);
54 }
55
56 START_TEST(GetTextExtentExPoint)
57 {
58 Test_GetTextExtentExPoint();
59 }
60