gdi32: Remove broken check for WinXP.
Dmitry Timoshkov
dmitry at codeweavers.com
Tue Nov 9 09:44:21 CST 2010
is_winxp is not TRUE on Wine, since Wine doesn't set DM_DISPLAYORIENTATION.
Problematic tests (if any) should be disabled with if (0) individually.
The problem could be easily reproduced by copying sserife.fon to windows/fonts,
at the moment the skip above the broken check hides the bug.
---
dlls/gdi32/tests/font.c | 114 +++++++++++++++++++++-------------------------
1 files changed, 52 insertions(+), 62 deletions(-)
diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
index cede3aa..66d26ca 100644
--- a/dlls/gdi32/tests/font.c
+++ b/dlls/gdi32/tests/font.c
@@ -3185,8 +3185,6 @@ static void test_AddFontMemResource(void)
void *font;
DWORD font_size, num_fonts;
HANDLE ret;
- DEVMODEA dmA;
- BOOL is_winxp;
if (!pAddFontMemResourceEx || !pRemoveFontMemResourceEx)
{
@@ -3201,73 +3199,65 @@ static void test_AddFontMemResource(void)
return;
}
- is_winxp = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dmA) &&
- (dmA.dmFields & DM_DISPLAYORIENTATION);
-
- if (is_winxp)
- {
- SetLastError(0xdeadbeef);
- 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);
+ 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);
- ret = pAddFontMemResourceEx(NULL, 10, 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);
+ ret = pAddFontMemResourceEx(NULL, 10, 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);
- ret = pAddFontMemResourceEx(NULL, 0, NULL, &num_fonts);
- ok(!ret, "AddFontMemResourceEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
- GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = pAddFontMemResourceEx(NULL, 0, NULL, &num_fonts);
+ ok(!ret, "AddFontMemResourceEx should fail\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
+ GetLastError());
- SetLastError(0xdeadbeef);
- ret = pAddFontMemResourceEx(NULL, 10, NULL, &num_fonts);
- ok(!ret, "AddFontMemResourceEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
- GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = pAddFontMemResourceEx(NULL, 10, NULL, &num_fonts);
+ ok(!ret, "AddFontMemResourceEx should fail\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
+ GetLastError());
- SetLastError(0xdeadbeef);
- ret = pAddFontMemResourceEx(font, 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);
+ ret = pAddFontMemResourceEx(font, 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);
- ret = pAddFontMemResourceEx(font, 10, 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);
+ ret = pAddFontMemResourceEx(font, 10, NULL, NULL);
+ ok(!ret, "AddFontMemResourceEx should fail\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
+ GetLastError());
- num_fonts = 0xdeadbeef;
- SetLastError(0xdeadbeef);
- ret = pAddFontMemResourceEx(font, 0, NULL, &num_fonts);
- ok(!ret, "AddFontMemResourceEx should fail\n");
- ok(GetLastError() == ERROR_INVALID_PARAMETER,
- "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
- GetLastError());
- ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
+ num_fonts = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = pAddFontMemResourceEx(font, 0, NULL, &num_fonts);
+ ok(!ret, "AddFontMemResourceEx should fail\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER,
+ "Expected GetLastError() to return ERROR_INVALID_PARAMETER, got %u\n",
+ GetLastError());
+ ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
- num_fonts = 0xdeadbeef;
- SetLastError(0xdeadbeef);
- ret = pAddFontMemResourceEx(font, 10, NULL, &num_fonts);
- ok(!ret, "AddFontMemResourceEx should fail\n");
- ok(GetLastError() == 0xdeadbeef,
- "Expected GetLastError() to return 0xdeadbeef, got %u\n",
- GetLastError());
- 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;
+ SetLastError(0xdeadbeef);
+ ret = pAddFontMemResourceEx(font, 10, NULL, &num_fonts);
+ ok(!ret, "AddFontMemResourceEx should fail\n");
+ ok(GetLastError() == 0xdeadbeef,
+ "Expected GetLastError() to return 0xdeadbeef, got %u\n",
+ GetLastError());
+ ok(num_fonts == 0xdeadbeef, "number of loaded fonts should be 0xdeadbeef\n");
num_fonts = 0xdeadbeef;
SetLastError(0xdeadbeef);
--
1.7.0.6
More information about the wine-patches
mailing list