Add some tests for GetTextExtentExPoint. Dedicated to Pigglesworth
[reactos.git] / rostests / apitests / gdi32api / tests / GetTextExtentExPoint.c
1 #define NUM_SYSCOLORS 31
2
3 INT
4 Test_GetTextExtentExPoint(PTESTINFO pti)
5 {
6 INT nFit;
7 SIZE size;
8 BOOL result;
9
10 SetLastError(0);
11
12 result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size);
13 TEST(result == 1);
14 TEST(nFit == 4);
15 TEST(GetLastError() == 0);
16 printf("nFit = %d\n", nFit);
17
18 result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
19 TEST(result == 1);
20 TEST(nFit == 0);
21 TEST(GetLastError() == 0);
22 printf("nFit = %d\n", nFit);
23
24 result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
25 TEST(result == 1);
26 TEST(nFit == 0);
27 TEST(GetLastError() == 0);
28
29 result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
30 TEST(result == 1);
31 TEST(nFit == 4);
32 TEST(GetLastError() == 0);
33
34 result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
35 TEST(result == 0);
36 TEST(GetLastError() == 87);
37
38 return APISTATUS_NORMAL;
39 }