Added test case for dialogs with 0x7fff font size

Patrick Gauthier webmaster at korosoft.net
Fri Oct 10 15:01:08 CDT 2008


---
 dlls/user32/tests/dialog.c |   67 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c
index ccb5e31..72feabd 100644
--- a/dlls/user32/tests/dialog.c
+++ b/dlls/user32/tests/dialog.c
@@ -926,6 +926,72 @@ static void test_DisabledDialogTest(void)
     ok(FALSE == g_terminated, "dialog with disabled ok button has been terminated\n");
 }
 
+static INT_PTR CALLBACK messageBoxFontDlgWinProc (HWND hDlg, UINT uiMsg, WPARAM wParam,
+        LPARAM lParam)
+{
+    return (uiMsg == WM_INITDIALOG);
+}
+
+static void test_MessageBoxFontTest(void)
+{
+    /* Define a dialog that sets 0x7fff as font, and define one control. If the
+     * dialog is created correctly, it means the 0x7fff was skipped correctly. */
+
+    static unsigned char test[] =
+    {
+        /* Dialog header */
+        0x01,0x00,              /* Version */
+        0xff,0xff,              /* Extended template marker */
+        0x00,0x00,0x00,0x00,    /* Context Help ID */
+        0x00,0x00,0x00,0x00,    /* Extended style */
+        0xc0,0x00,0xc8,0x80,    /* Style (WS_SYSMENU|WS_CAPTION|WS_POPUP|DS_SETFONT|DS_MODALFRAME) */
+        0x01,0x00,              /* Control count */
+        0x00,0x00,              /* X */
+        0x00,0x00,              /* Y */
+        0x80,0x00,              /* Width */
+        0x80,0x00,              /* Height */
+        0x00,0x00,              /* Menu name */
+        0x00,0x00,              /* Class name */
+        'T',0x00,'e',0x00,      /* Caption (unicode) */
+        's',0x00,'t',0x00,
+        0x00,0x00,
+        0xff,0x7f,              /* Font height (0x7fff = message box font) */
+
+        /* Control #1 */
+        0x00,0x00,              /* Align to DWORD (header is 42 bytes) */
+        0x00,0x00,0x00,0x00,    /* Context Help ID */
+        0x00,0x00,0x00,0x00,    /* Extended style */
+        0x00,0x00,0x00,0x50,    /* Style (WS_CHILD|WS_VISIBLE) */
+        0x00,0x00,              /* X */
+        0x00,0x00,              /* Y */
+        0x80,0x00,              /* Width */
+        0x80,0x00,              /* Height */
+        0xff,0xff,0xff,0xff,    /* Control ID */
+        0xff,0xff,0x82,0x00,    /* Class (Static) */
+        'W',0x00,'I',0x00,      /* Caption (unicode) */
+        'N',0x00,'E',0x00,
+        ' ',0x00,'d',0x00,
+        'i',0x00,'a',0x00,
+        'l',0x00,'o',0x00,
+        'g',0x00,' ',0x00,
+        't',0x00,'e',0x00,
+        's',0x00,'t',0x00,
+        '.',0x00,0x00,0x00,
+        0x00,0x00,              /* Size of extended data */
+
+        0x00,0x00               /* Align to DWORD */
+    };
+
+    /* Now check if it can be created */
+    HWND hdlg = CreateDialogIndirectParam(g_hinst, (LPCDLGTEMPLATE)test, NULL, messageBoxFontDlgWinProc, 0);
+
+    broken(hdlg == NULL);
+    if (hdlg)
+        ok(IsWindow(hdlg), "dialog with message box font was successfully created");
+
+    DestroyWindow(hdlg);
+}
+
 START_TEST(dialog)
 {
     g_hinst = GetModuleHandleA (0);
@@ -939,4 +1005,5 @@ START_TEST(dialog)
     test_GetDlgItemText();
     test_DialogBoxParamA();
     test_DisabledDialogTest();
+    test_MessageBoxFontTest();
 }
-- 
1.5.4.3


--Boundary_(ID_pgvlvdtzZYU+NQCrUx1mgQ)--



More information about the wine-patches mailing list