Commit be6295ab authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32/tests: Add more SelectObject tests.

parent dc73184c
......@@ -2673,6 +2673,12 @@ static void test_select_object(void)
hbm_old = SelectObject(hdc, hbm_old);
ok(hbm_old == hbm, "SelectObject failed\n");
SetLastError(0xdeadbeef);
hbm_old = SelectObject(NULL, hbm);
ok(!hbm_old, "SelectObject returned %p\n", hbm_old);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n",
GetLastError());
DeleteObject(hbm);
/* test an 1-bpp bitmap */
......
......@@ -7743,6 +7743,32 @@ done:
ReleaseDC(0, hdc);
}
static void test_select_object(void)
{
HFONT hfont, old_font;
LOGFONTA lf;
memset(&lf, 0, sizeof lf);
lf.lfCharSet = ANSI_CHARSET;
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfWeight = FW_DONTCARE;
lf.lfHeight = 16;
lf.lfWidth = 16;
lf.lfQuality = DEFAULT_QUALITY;
lstrcpyA(lf.lfFaceName, "Arial");
hfont = create_font("Arial", &lf);
SetLastError(0xdeadbeef);
old_font = SelectObject(NULL, hfont);
ok(!old_font, "SelectObject returned %p\n", old_font);
ok(GetLastError() == ERROR_INVALID_HANDLE, "GetLastError() = %u\n",
GetLastError());
DeleteObject(hfont);
}
START_TEST(font)
{
static const char *test_names[] =
......@@ -7829,6 +7855,7 @@ START_TEST(font)
test_ttf_names();
test_lang_names();
test_char_width();
test_select_object();
/* These tests should be last test until RemoveFontResource
* is properly implemented.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment