2010-08-24 13:54:10 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS api tests
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* PURPOSE: Test for GetTextExtentExPoint
|
|
|
|
* PROGRAMMERS: Timo Kreuzer
|
2019-04-03 08:22:21 +00:00
|
|
|
* Katayama Hirofumi MZ
|
2010-08-24 13:54:10 +00:00
|
|
|
*/
|
2010-08-03 23:15:20 +00:00
|
|
|
|
2017-12-02 20:00:06 +00:00
|
|
|
#include "precomp.h"
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
void Test_GetTextExtentExPoint()
|
2010-08-03 23:15:20 +00:00
|
|
|
{
|
|
|
|
INT nFit;
|
|
|
|
SIZE size;
|
|
|
|
BOOL result;
|
|
|
|
|
|
|
|
SetLastError(0);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, 1000, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 1);
|
|
|
|
ok_int(nFit, 4);
|
|
|
|
ok_err(0);
|
2010-08-03 23:15:20 +00:00
|
|
|
printf("nFit = %d\n", nFit);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 1);
|
|
|
|
ok_int(nFit, 0);
|
|
|
|
ok_err(0);
|
2010-08-03 23:15:20 +00:00
|
|
|
printf("nFit = %d\n", nFit);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 1);
|
|
|
|
ok_int(nFit, 0);
|
|
|
|
ok_err(0);
|
2010-08-03 23:15:20 +00:00
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 1);
|
|
|
|
ok_int(nFit, 4);
|
|
|
|
ok_err(0);
|
2010-08-03 23:15:20 +00:00
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 0);
|
|
|
|
ok_err(87);
|
2010-08-03 23:15:20 +00:00
|
|
|
|
2010-08-24 13:54:10 +00:00
|
|
|
result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 1);
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size);
|
2019-04-03 08:22:21 +00:00
|
|
|
ok_int(result, 0);
|
2010-08-03 23:15:20 +00:00
|
|
|
}
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
START_TEST(GetTextExtentExPoint)
|
|
|
|
{
|
|
|
|
Test_GetTextExtentExPoint();
|
|
|
|
}
|
|
|
|
|