e304986d13fe4342ee0082f5c977d6b7c7905d20
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetTextFace
5 * PROGRAMMERS: Timo Kreuzer
10 void Test_GetTextFace()
17 hDC
= CreateCompatibleDC(NULL
);
18 ok(hDC
!= 0, "CreateCompatibleDC failed, skipping tests.\n");
21 /* Whether asking for the string size (NULL buffer) ignores the size argument */
22 SetLastError(0xE000BEEF);
23 ret
= GetTextFaceW(hDC
, 0, NULL
);
25 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
28 SetLastError(0xE000BEEF);
29 ret
= GetTextFaceW(hDC
, -1, NULL
);
32 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
35 SetLastError(0xE000BEEF);
36 ret
= GetTextFaceW(hDC
, 10000, NULL
);
39 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
42 /* Whether the buffer is correctly filled */
43 SetLastError(0xE000BEEF);
44 ret
= GetTextFaceW(hDC
, 20, Buffer
);
47 TEST(Buffer
[ret
- 1] == 0);
48 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
50 SetLastError(0xE000BEEF);
51 ret
= GetTextFaceW(hDC
, 1, Buffer
);
53 TEST(Buffer
[ret
- 1] == 0);
54 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
56 SetLastError(0xE000BEEF);
57 ret
= GetTextFaceW(hDC
, 2, Buffer
);
59 TEST(Buffer
[ret
- 1] == 0);
60 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
62 /* Whether invalid buffer sizes are correctly ignored */
63 SetLastError(0xE000BEEF);
64 ret
= GetTextFaceW(hDC
, 0, Buffer
);
66 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError() == %ld\n", GetLastError());
68 SetLastError(0xE000BEEF);
69 ret
= GetTextFaceW(hDC
, -1, Buffer
);
71 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError() == %ld\n", GetLastError());
76 START_TEST(GetTextFace
)