[ros-diffs] [gedmurphy] 22847: update comctl32 regression tests to Wine-0_9_16, which now includes listview testing

gedmurphy at svn.reactos.org gedmurphy at svn.reactos.org
Tue Jul 4 22:58:30 CEST 2006


Author: gedmurphy
Date: Wed Jul  5 00:58:29 2006
New Revision: 22847

URL: http://svn.reactos.org/svn/reactos?rev=22847&view=rev
Log:
update comctl32 regression tests to Wine-0_9_16, which now includes listview testing

Added:
    trunk/reactos/regtests/winetests/comctl32/listview.c
Modified:
    trunk/reactos/regtests/winetests/comctl32/comctl32.rbuild
    trunk/reactos/regtests/winetests/comctl32/header.c
    trunk/reactos/regtests/winetests/comctl32/mru.c

Modified: trunk/reactos/regtests/winetests/comctl32/comctl32.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/comctl32/comctl32.rbuild?rev=22847&r1=22846&r2=22847&view=diff
==============================================================================
--- trunk/reactos/regtests/winetests/comctl32/comctl32.rbuild (original)
+++ trunk/reactos/regtests/winetests/comctl32/comctl32.rbuild Wed Jul  5 00:58:29 2006
@@ -10,6 +10,7 @@
     <file>dpa.c</file>
     <file>header.c</file>
     <file>imagelist.c</file>
+    <file>listview.c</file>
     <file>monthcal.c</file>
     <file>mru.c</file>
     <file>progress.c</file>

Modified: trunk/reactos/regtests/winetests/comctl32/header.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/comctl32/header.c?rev=22847&r1=22846&r2=22847&view=diff
==============================================================================
--- trunk/reactos/regtests/winetests/comctl32/header.c (original)
+++ trunk/reactos/regtests/winetests/comctl32/header.c Wed Jul  5 00:58:29 2006
@@ -225,7 +225,7 @@
 
     /* Windows implicitly sets some format bits in INSERTITEM */
 
-    /* HDF_STRING is automaticaly set and cleared for no text */
+    /* HDF_STRING is automatically set and cleared for no text */
     hdiCreate.mask = HDI_TEXT|HDI_WIDTH|HDI_FORMAT;
     hdiCreate.pszText = text;
     hdiCreate.cxy = 100;

Added: trunk/reactos/regtests/winetests/comctl32/listview.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/comctl32/listview.c?rev=22847&view=auto
==============================================================================
--- trunk/reactos/regtests/winetests/comctl32/listview.c (added)
+++ trunk/reactos/regtests/winetests/comctl32/listview.c Wed Jul  5 00:58:29 2006
@@ -1,0 +1,97 @@
+/*
+ * ListView tests
+ *
+ * Copyright 2006 Mike McCormack for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdio.h>
+#include <windows.h>
+#include <commctrl.h>
+
+#include "wine/test.h"
+
+START_TEST(listview)
+{
+    HWND hwnd, hwndparent = 0;
+    INITCOMMONCONTROLSEX icc;
+    DWORD r;
+    LVITEM item;
+    HIMAGELIST himl;
+    HBITMAP hbmp;
+    RECT r1, r2;
+
+    icc.dwICC = 0;
+    icc.dwSize = sizeof icc;
+    InitCommonControlsEx(&icc);
+
+    himl = ImageList_Create(40, 40, 0, 4, 4);
+    ok(himl != NULL, "failed to create imagelist\n");
+
+    hbmp = CreateBitmap(40, 40, 1, 1, NULL);
+    ok(hbmp != NULL, "failed to create bitmap\n");
+
+    r = ImageList_Add(himl, hbmp, 0);
+    ok(r == 0, "should be zero\n");
+
+    hwnd = CreateWindowEx(0, "SysListView32", "foo", LVS_OWNERDRAWFIXED, 
+                10, 10, 100, 200, hwndparent, NULL, NULL, NULL);
+    ok(hwnd != NULL, "failed to create listview window\n");
+
+    r = SendMessage(hwnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, 0x940);
+    ok(r == 0, "should return zero\n");
+
+    r = SendMessage(hwnd, LVM_SETIMAGELIST, 0, (LPARAM)himl);
+    ok(r == 0, "should return zero\n");
+
+    r = SendMessage(hwnd, LVM_SETICONSPACING, 0, MAKELONG(100,50));
+    /* returns dimensions */
+
+    r = SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0);
+    ok(r == 0, "should be zero items\n");
+
+    item.mask = LVIF_IMAGE | LVIF_TEXT;
+    item.iItem = 0;
+    item.iSubItem = 1;
+    item.iImage = 0;
+    r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
+    ok(r == -1, "should fail\n");
+
+    item.iSubItem = 0;
+    item.pszText = "hello";
+    r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
+    ok(r == 0, "should not fail\n");
+
+    memset(&r1, 0, sizeof r1);
+    r1.left = LVIR_ICON;
+    r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r1);
+
+    r = SendMessage(hwnd, LVM_DELETEALLITEMS, 0, 0);
+    ok(r == TRUE, "should not fail\n");
+
+    item.iSubItem = 0;
+    item.pszText = "hello";
+    r = SendMessage(hwnd, LVM_INSERTITEM, 0, (LPARAM) &item);
+    ok(r == 0, "should not fail\n");
+
+    memset(&r2, 0, sizeof r2);
+    r2.left = LVIR_ICON;
+    r = SendMessage(hwnd, LVM_GETITEMRECT, 0, (LPARAM) &r2);
+
+    ok(!memcmp(&r1, &r2, sizeof r1), "rectangle should be the same\n");
+
+    DestroyWindow(hwnd);
+}

Modified: trunk/reactos/regtests/winetests/comctl32/mru.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/regtests/winetests/comctl32/mru.c?rev=22847&r1=22846&r2=22847&view=diff
==============================================================================
--- trunk/reactos/regtests/winetests/comctl32/mru.c (original)
+++ trunk/reactos/regtests/winetests/comctl32/mru.c Wed Jul  5 00:58:29 2006
@@ -100,7 +100,7 @@
     char buff[128];
     HKEY hKey = NULL;
     DWORD type, size, ret;
-    size_t i;
+    unsigned int i;
 
     ok(!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_FULLKEY, &hKey),
        "Couldn't open test key \"%s\"\n", REG_TEST_FULLKEY);




More information about the Ros-diffs mailing list