Just using the servers to test for now because this test seems to pass on Windows.
This test seems to be passing for me on Windows 10.
Signed-off-by: David Kahurani k.kahurani@gmail.com
From: David Kahurani k.kahurani@gmail.com
This test seems to be passing for me on Windows 10.
Signed-off-by: David Kahurani k.kahurani@gmail.com --- dlls/gdiplus/tests/stringformat.c | 54 ++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/tests/stringformat.c b/dlls/gdiplus/tests/stringformat.c index 71fb860e474..a98705819ca 100644 --- a/dlls/gdiplus/tests/stringformat.c +++ b/dlls/gdiplus/tests/stringformat.c @@ -373,12 +373,28 @@ static void test_getgenericdefault(void) expect(Ok, stat); }
+void set_rect_empty(RectF *rect) +{ + rect->X = 0; + rect->Y = 0; + rect->Width = 0; + rect->Height = 0; +} + static void test_stringformatflags(void) { GpStringFormat *format; GpStatus stat;
- INT flags; + HDC hdc; + GpGraphics *graphics; + LOGFONTA lf; + GpFont *font; + RectF rect, bounds; + REAL height; + const WCHAR *string = L"Hello"; + INT flags, linesfilled; +
stat = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); expect(Ok, stat); @@ -430,6 +446,42 @@ static void test_stringformatflags(void) expect(Ok, stat); expect(0xdeadbeef, flags);
+ hdc = CreateCompatibleDC(0); + GdipCreateFromHDC(hdc, &graphics); + memset(&lf, 0, sizeof(lf)); + + lstrcpyA(lf.lfFaceName, "Tahoma"); + lf.lfHeight = -100; + stat = GdipCreateFontFromLogfontA(hdc, &lf, &font); + expect(Ok, stat); + stat = GdipGetFontHeight(font, graphics, &height); + stat = GdipSetStringFormatFlags(format, StringFormatFlagsLineLimit); + expect(Ok, stat); + stat = GdipGetStringFormatFlags(format, &flags); + expect(Ok, stat); + expect(StringFormatFlagsLineLimit, flags); + /* Get an estimate of line height */ + set_rect_empty(&rect); + set_rect_empty(&bounds); + stat = GdipMeasureString(graphics, string, 5, font, &rect, format, &bounds, NULL, NULL); + expect(Ok, stat); + + /* request to draw in a shallow rectangle with half the line height */ + rect.Height = bounds.Height / 2; + rect.Width = 600; + set_rect_empty(&bounds); + stat = GdipMeasureString(graphics, string, 5, font, &rect, format, &bounds, NULL, &linesfilled); + expect(Ok, stat); + todo_wine + expectf(rect.Height, bounds.Height); + + todo_wine + expect(1, linesfilled); + + DeleteObject(hdc); + GdipDeleteGraphics(graphics); + GdipDeleteFont(font); + stat = GdipDeleteStringFormat(format); expect(Ok, stat); }
You can access the testbot directly, and not need to keep creating and pushing to MR's.
On Sat Aug 12 14:20:42 2023 +0000, Jeffrey Smith wrote:
You can access the testbot directly, and not need to keep creating and pushing to MR's.
The workflow is a little different, but it also gives you greater control of the testing.
On Sat Aug 12 14:20:42 2023 +0000, Jeffrey Smith wrote:
The workflow is a little different, but it also gives you greater control of the testing.
@kahurani As this appears to only have been for personal testing, could you please close out this MR?
On Mon Feb 26 21:20:10 2024 +0000, Jeffrey Smith wrote:
@kahurani As this appears to only have been for personal testing, could you please close out this MR?
@whydoubt It is indeed possible to close this bug but this is actually bug: https://bugs.winehq.org/show_bug.cgi?id=46947. This is not something that just happened in personal testing.
In the bug the program tries to write text to fixed-size rectangles/boxes. The text fits and renders on Windows but doesn't on Wine.
Since it didn't look possible to fix this issue, at least now, the possible outcome for this MR would have been to add a relevant todo in the tests.
On Tue Feb 27 03:58:43 2024 +0000, David Kahurani wrote:
@whydoubt It is indeed possible to close this bug but this is actually bug: https://bugs.winehq.org/show_bug.cgi?id=46947. This is not something that just happened in personal testing. In the bug the program tries to write text to fixed-size rectangles/boxes. The text fits and renders on Windows but doesn't on Wine. Since it didn't look possible to fix this issue, at least now, the possible outcome for this MR would have been to add a relevant todo in the tests.
Ah, no problem then. I just had the wrong impression, as the MR was missing that context.