Dmitry Timoshkov : comctl32/tests: Add a test for system class properties.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Nov 23 09:59:46 CST 2015


Module: wine
Branch: master
Commit: acc1092ea9c3cdde8611c8fc27be6dbdabd8e6b7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=acc1092ea9c3cdde8611c8fc27be6dbdabd8e6b7

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Mon Nov 23 16:37:28 2015 +0800

comctl32/tests: Add a test for system class properties.

This is basically a copy of user32/class.c test.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/comctl32/tests/misc.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/dlls/comctl32/tests/misc.c b/dlls/comctl32/tests/misc.c
index 9a4b902..5cc6c29 100644
--- a/dlls/comctl32/tests/misc.c
+++ b/dlls/comctl32/tests/misc.c
@@ -357,6 +357,36 @@ static void test_LoadIconWithScaleDown(void)
     FreeLibrary(hinst);
 }
 
+static void check_class( const char *name, int must_exist, UINT style, UINT ignore )
+{
+    WNDCLASSA wc;
+
+    if (GetClassInfoA( 0, name, &wc ))
+    {
+todo_wine
+        ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n",
+            name, ~wc.style & style, wc.style, style );
+        ok( !(wc.style & ~style), "System class %s has extra bits %x (%08x/%08x)\n",
+            name, wc.style & ~style, wc.style, style );
+        ok( !wc.hInstance, "System class %s has hInstance %p\n", name, wc.hInstance );
+    }
+    else
+        ok( !must_exist, "System class %s does not exist\n", name );
+}
+
+/* test styles of system classes */
+static void test_builtin_classes(void)
+{
+    /* check style bits */
+    check_class( "Button",     1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0 );
+    check_class( "ComboBox",   1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0 );
+    check_class( "Edit",       1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0 );
+    check_class( "ListBox",    1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0 );
+    check_class( "ScrollBar",  1, CS_PARENTDC | CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW | CS_GLOBALCLASS, 0 );
+    check_class( "Static",     1, CS_PARENTDC | CS_DBLCLKS | CS_GLOBALCLASS, 0 );
+    check_class( "ComboLBox",  1, CS_SAVEBITS | CS_DBLCLKS | CS_DROPSHADOW | CS_GLOBALCLASS, CS_DROPSHADOW );
+}
+
 START_TEST(misc)
 {
     ULONG_PTR ctx_cookie;
@@ -371,6 +401,7 @@ START_TEST(misc)
     if (!load_v6_module(&ctx_cookie, &hCtx))
         return;
 
+    test_builtin_classes();
     test_TaskDialogIndirect();
     test_LoadIconWithScaleDown();
 




More information about the wine-cvs mailing list