2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetTextFace
5 * PROGRAMMERS: Timo Kreuzer
12 #define TEST(x) ok(x, #x"\n")
13 #define RTEST(x) ok(x, #x"\n")
15 void Test_GetTextFace()
22 hDC
= CreateCompatibleDC(NULL
);
23 ok(hDC
!= 0, "CreateCompatibleDC failed, skipping tests.\n");
26 /* Whether asking for the string size (NULL buffer) ignores the size argument */
27 SetLastError(0xE000BEEF);
28 ret
= GetTextFaceW(hDC
, 0, NULL
);
30 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
33 SetLastError(0xE000BEEF);
34 ret
= GetTextFaceW(hDC
, -1, NULL
);
37 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
40 SetLastError(0xE000BEEF);
41 ret
= GetTextFaceW(hDC
, 10000, NULL
);
44 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
47 /* Whether the buffer is correctly filled */
48 SetLastError(0xE000BEEF);
49 ret
= GetTextFaceW(hDC
, 20, Buffer
);
52 TEST(Buffer
[ret
- 1] == 0);
53 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
55 SetLastError(0xE000BEEF);
56 ret
= GetTextFaceW(hDC
, 1, Buffer
);
58 TEST(Buffer
[ret
- 1] == 0);
59 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
61 SetLastError(0xE000BEEF);
62 ret
= GetTextFaceW(hDC
, 2, Buffer
);
64 TEST(Buffer
[ret
- 1] == 0);
65 ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
67 /* Whether invalid buffer sizes are correctly ignored */
68 SetLastError(0xE000BEEF);
69 ret
= GetTextFaceW(hDC
, 0, Buffer
);
71 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError() == %ld\n", GetLastError());
73 SetLastError(0xE000BEEF);
74 ret
= GetTextFaceW(hDC
, -1, Buffer
);
76 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError() == %ld\n", GetLastError());
81 START_TEST(GetTextFace
)