Commit d419f243 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdi32: Remove broken check for WinXP.

parent 7a354177
...@@ -3185,8 +3185,6 @@ static void test_AddFontMemResource(void) ...@@ -3185,8 +3185,6 @@ static void test_AddFontMemResource(void)
void *font; void *font;
DWORD font_size, num_fonts; DWORD font_size, num_fonts;
HANDLE ret; HANDLE ret;
DEVMODEA dmA;
BOOL is_winxp;
if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx) if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx)
{ {
...@@ -3201,62 +3199,59 @@ static void test_AddFontMemResource(void) ...@@ -3201,62 +3199,59 @@ static void test_AddFontMemResource(void)
return; return;
} }
is_winxp = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dmA) && SetLastError(0xdeadbeef);
(dmA.dmFields & DM_DISPLAYORIENTATION); ret = pAddFontMemResourceEx(NULL, 0, NULL, NULL);
ok(!ret, "AddFontMemResourceEx should fail\n");
if (is_winxp) ok(GetLastError() == ERROR_INVALID_PARAMETER,
{ "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
SetLastError(0xdeadbeef); GetLastError());
ret = pAddFontMemResourceEx(NULL, 0, NULL, NULL);
ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(NULL, 10, NULL, NULL); ret = pAddFontMemResourceEx(NULL, 10, NULL, NULL);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(NULL, 0, NULL, &num_fonts); ret = pAddFontMemResourceEx(NULL, 0, NULL, &num_fonts);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(NULL, 10, NULL, &num_fonts); ret = pAddFontMemResourceEx(NULL, 10, NULL, &num_fonts);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(font, 0, NULL, NULL); ret = pAddFontMemResourceEx(font, 0, NULL, NULL);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(font, 10, NULL, NULL); ret = pAddFontMemResourceEx(font, 10, NULL, NULL);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
num_fonts = 0xdeadbeef; num_fonts = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(font, 0, NULL, &num_fonts); ret = pAddFontMemResourceEx(font, 0, NULL, &num_fonts);
ok(!ret, "AddFontMemResourceEx should fail\n"); ok(!ret, "AddFontMemResourceEx should fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n", "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
GetLastError()); GetLastError());
ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n"); ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
if (0) /* hangs under windows 2000 */
{
num_fonts = 0xdeadbeef; num_fonts = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pAddFontMemResourceEx(font, 10, NULL, &num_fonts); ret = pAddFontMemResourceEx(font, 10, NULL, &num_fonts);
...@@ -3266,8 +3261,6 @@ static void test_AddFontMemResource(void) ...@@ -3266,8 +3261,6 @@ static void test_AddFontMemResource(void)
GetLastError()); GetLastError());
ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n"); ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
} }
else
win_skip("AddFontMemResourceEx invalid parameter tests are problematic on Win2k\n");
num_fonts = 0xdeadbeef; num_fonts = 0xdeadbeef;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
......
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