mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:45:41 +00:00
[ROSTESTS][GDI32_APITEST] Refactor testcases (#1457)
[ROSTESTS][GDI32_APITEST] Refactor testcases
This commit is contained in:
parent
39c0fd5722
commit
f65a62ea5b
5 changed files with 213 additions and 209 deletions
|
@ -32,21 +32,21 @@ void Test_GetTextFace(void)
|
|||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, 0, NULL);
|
||||
TEST(ret != 0);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_err(0xE000BEEF);
|
||||
ret2 = ret;
|
||||
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, -1, NULL);
|
||||
TEST(ret != 0);
|
||||
TEST(ret == ret2);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, ret2);
|
||||
ok_err(0xE000BEEF);
|
||||
ret2 = ret;
|
||||
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, 10000, NULL);
|
||||
TEST(ret != 0);
|
||||
TEST(ret == ret2);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, ret2);
|
||||
ok_err(0xE000BEEF);
|
||||
ret2 = ret;
|
||||
|
||||
/* Whether the buffer is correctly filled */
|
||||
|
@ -54,31 +54,31 @@ void Test_GetTextFace(void)
|
|||
ret = GetTextFaceW(hDC, 20, Buffer);
|
||||
TEST(ret != 0);
|
||||
TEST(ret <= 20);
|
||||
TEST(Buffer[ret - 1] == 0);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(Buffer[ret - 1], 0);
|
||||
ok_err(0xE000BEEF);
|
||||
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, 1, Buffer);
|
||||
TEST(ret == 1);
|
||||
TEST(Buffer[ret - 1] == 0);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, 1);
|
||||
ok_int(Buffer[ret - 1], 0);
|
||||
ok_err(0xE000BEEF);
|
||||
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, 2, Buffer);
|
||||
TEST(ret == 2);
|
||||
TEST(Buffer[ret - 1] == 0);
|
||||
ok(GetLastError() == 0xE000BEEF, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, 2);
|
||||
ok_int(Buffer[ret - 1], 0);
|
||||
ok_err(0xE000BEEF);
|
||||
|
||||
/* Whether invalid buffer sizes are correctly ignored */
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, 0, Buffer);
|
||||
TEST(ret == 0);
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, 0);
|
||||
ok_err(ERROR_INVALID_PARAMETER);
|
||||
|
||||
SetLastError(0xE000BEEF);
|
||||
ret = GetTextFaceW(hDC, -1, Buffer);
|
||||
TEST(ret == 0);
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError() == %ld\n", GetLastError());
|
||||
ok_int(ret, 0);
|
||||
ok_err(ERROR_INVALID_PARAMETER);
|
||||
|
||||
DeleteDC(hDC);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue