From f5cbabe20cc655579197dc01c9fe5a977f38d5ff Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 8 Oct 2008 10:58:41 +0000 Subject: [PATCH] Add basic tests for BeginPath andd SetMapMode svn path=/trunk/; revision=36691 --- rostests/apitests/gdi32api/testlist.c | 12 +++---- rostests/apitests/gdi32api/tests/BeginPath.c | 24 +++++++++++++ rostests/apitests/gdi32api/tests/SetMapMode.c | 34 +++++++++++++++++++ 3 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 rostests/apitests/gdi32api/tests/BeginPath.c create mode 100644 rostests/apitests/gdi32api/tests/SetMapMode.c diff --git a/rostests/apitests/gdi32api/testlist.c b/rostests/apitests/gdi32api/testlist.c index d38c267773c..2c9788ac19f 100644 --- a/rostests/apitests/gdi32api/testlist.c +++ b/rostests/apitests/gdi32api/testlist.c @@ -6,6 +6,7 @@ /* include the tests */ #include "tests/AddFontResource.c" #include "tests/AddFontResourceEx.c" +#include "tests/BeginPath.c" #include "tests/CreateBitmapIndirect.c" #include "tests/CreateCompatibleDC.c" #include "tests/CreateFont.c" @@ -35,23 +36,17 @@ #include "tests/GetStockObject.c" #include "tests/SelectObject.c" #include "tests/SetDCPenColor.c" +#include "tests/SetMapMode.c" #include "tests/SetSysColors.c" #include "tests/SetWorldTransform.c" - - - - - - - - /* The List of tests */ TESTENTRY TestList[] = { { L"AddFontResourceA", Test_AddFontResourceA }, { L"AddFontResourceEx", Test_AddFontResourceEx }, + { L"BeginPath", Test_BeginPath }, { L"CreateBitmapIndirect", Test_CreateBitmapIndirect }, { L"CreateCompatibleDC", Test_CreateCompatibleDC }, { L"CreateFont", Test_CreateFont }, @@ -81,6 +76,7 @@ TESTENTRY TestList[] = { L"GetStockObject", Test_GetStockObject }, { L"SelectObject", Test_SelectObject }, { L"SetDCPenColor", Test_SetDCPenColor }, + { L"SetMapMode", Test_SetMapMode }, { L"SetSysColors", Test_SetSysColors }, { L"SetWorldTransform", Test_SetWorldTransform }, }; diff --git a/rostests/apitests/gdi32api/tests/BeginPath.c b/rostests/apitests/gdi32api/tests/BeginPath.c new file mode 100644 index 00000000000..f4671207dfe --- /dev/null +++ b/rostests/apitests/gdi32api/tests/BeginPath.c @@ -0,0 +1,24 @@ + + +INT +Test_BeginPath(PTESTINFO pti) +{ + HDC hDC; + BOOL ret; + + SetLastError(0); + ret = BeginPath(0); + TEST(ret == 0); + TEST(GetLastError() == ERROR_INVALID_HANDLE); + + hDC = CreateCompatibleDC(NULL); + + SetLastError(0); + ret = BeginPath(hDC); + TEST(ret == 1); + TEST(GetLastError() == 0); + + DeleteDC(hDC); + + return APISTATUS_NORMAL; +} diff --git a/rostests/apitests/gdi32api/tests/SetMapMode.c b/rostests/apitests/gdi32api/tests/SetMapMode.c new file mode 100644 index 00000000000..79ce7497bc3 --- /dev/null +++ b/rostests/apitests/gdi32api/tests/SetMapMode.c @@ -0,0 +1,34 @@ + + + +INT +Test_SetMapMode(PTESTINFO pti) +{ + HDC hDC; + SIZE WindowExt, ViewportExt; + + hDC = CreateCompatibleDC(NULL); + ASSERT(hDC); + + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + + ASSERT(WindowExt.cx == 1); + ASSERT(WindowExt.cy == 1); + ASSERT(ViewportExt.cx == 1); + ASSERT(ViewportExt.cy == 1); + + SetMapMode(hDC, MM_ISOTROPIC); + + GetWindowExtEx(hDC, &WindowExt); + GetViewportExtEx(hDC, &ViewportExt); + + TEST(WindowExt.cx == 3600); + TEST(WindowExt.cy == 2700); + TEST(ViewportExt.cx == GetDeviceCaps(GetDC(0), HORZRES)); + TEST(ViewportExt.cy == -GetDeviceCaps(GetDC(0), VERTRES)); + + DeleteDC(hDC); + + return APISTATUS_NORMAL; +}