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
|
|
|
|
*/
|
2010-08-03 23:15:20 +00:00
|
|
|
|
2013-09-22 17:52:42 +00:00
|
|
|
#include <apitest.h>
|
|
|
|
|
2013-02-10 16:48:18 +00:00
|
|
|
#include <stdio.h>
|
2013-02-05 17:54:22 +00:00
|
|
|
#include <wingdi.h>
|
|
|
|
#include <winuser.h>
|
2010-08-24 13:54:10 +00:00
|
|
|
|
2010-10-17 14:50:02 +00:00
|
|
|
#define TEST(x) ok(x, #x"\n")
|
|
|
|
#define RTEST(x) ok(x, #x"\n")
|
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);
|
|
|
|
TEST(result == 1);
|
|
|
|
TEST(nFit == 4);
|
|
|
|
TEST(GetLastError() == 0);
|
|
|
|
printf("nFit = %d\n", nFit);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, 1, &nFit, NULL, &size);
|
|
|
|
TEST(result == 1);
|
|
|
|
TEST(nFit == 0);
|
|
|
|
TEST(GetLastError() == 0);
|
|
|
|
printf("nFit = %d\n", nFit);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, 0, &nFit, NULL, &size);
|
|
|
|
TEST(result == 1);
|
|
|
|
TEST(nFit == 0);
|
|
|
|
TEST(GetLastError() == 0);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -1, &nFit, NULL, &size);
|
|
|
|
TEST(result == 1);
|
|
|
|
TEST(nFit == 4);
|
|
|
|
TEST(GetLastError() == 0);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -2, &nFit, NULL, &size);
|
|
|
|
TEST(result == 0);
|
|
|
|
TEST(GetLastError() == 87);
|
|
|
|
|
2010-08-24 13:54:10 +00:00
|
|
|
result = GetTextExtentExPointW(GetDC(0), L"test", 4, -10, &nFit, NULL, &size);
|
|
|
|
TEST(result == 1);
|
|
|
|
|
|
|
|
result = GetTextExtentExPointA(GetDC(0), "test", 4, -10, &nFit, NULL, &size);
|
|
|
|
TEST(result == 0);
|
2010-08-03 23:15:20 +00:00
|
|
|
}
|
2010-08-24 13:54:10 +00:00
|
|
|
|
|
|
|
START_TEST(GetTextExtentExPoint)
|
|
|
|
{
|
|
|
|
Test_GetTextExtentExPoint();
|
|
|
|
}
|
|
|
|
|