[ROSTESTS][GDI32_APITEST] Refactor testcases (#1457)

[ROSTESTS][GDI32_APITEST] Refactor testcases
This commit is contained in:
Katayama Hirofumi MZ 2019-04-03 17:22:21 +09:00 committed by GitHub
parent 39c0fd5722
commit f65a62ea5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 213 additions and 209 deletions

View file

@ -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);
}