[COMCTL32_WINETEST]
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Sep 2013 20:07:14 +0000 (20:07 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 14 Sep 2013 20:07:14 +0000 (20:07 +0000)
* Sync with Wine 1.7.1.

svn path=/trunk/; revision=60118

13 files changed:
rostests/winetests/comctl32/CMakeLists.txt
rostests/winetests/comctl32/comboex.c
rostests/winetests/comctl32/datetime.c
rostests/winetests/comctl32/header.c
rostests/winetests/comctl32/imagelist.c
rostests/winetests/comctl32/listview.c
rostests/winetests/comctl32/misc.c
rostests/winetests/comctl32/monthcal.c
rostests/winetests/comctl32/pager.c
rostests/winetests/comctl32/progress.c
rostests/winetests/comctl32/propsheet.c
rostests/winetests/comctl32/rebar.c
rostests/winetests/comctl32/trackbar.c

index 2326087..f0246ac 100644 (file)
@@ -29,18 +29,13 @@ list(APPEND SOURCE
     updown.c
     testlist.c)
 
-add_executable(comctl32_winetest
-    ${SOURCE}
-    rsrc.rc)
-
-target_link_libraries(comctl32_winetest wine)
+add_executable(comctl32_winetest ${SOURCE} rsrc.rc)
+set_module_type(comctl32_winetest win32cui)
+add_importlibs(comctl32_winetest comctl32 ole32 user32 gdi32 advapi32 msvcrt kernel32)
+add_cd_file(TARGET comctl32_winetest DESTINATION reactos/bin FOR all)
 
 if(NOT MSVC)
     # FIXME: http://www.cmake.org/Bug/view.php?id=12998
     #add_target_compile_flags(comctl32_winetest "-Wno-format")
     set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-format")
 endif()
-
-set_module_type(comctl32_winetest win32cui)
-add_importlibs(comctl32_winetest comctl32 ole32 user32 gdi32 advapi32 msvcrt kernel32 ntdll)
-add_cd_file(TARGET comctl32_winetest DESTINATION reactos/bin FOR all)
index ed331a5..0f78bbe 100644 (file)
@@ -280,8 +280,6 @@ static void test_WM_LBUTTONDOWN(void)
        GetLastError());
     hList = cbInfo.hwndList;
 
-    trace("hWnd=%p, hComboEx=%p, hCombo=%p, hList=%p, hEdit=%p\n",
-         hComboExParentWnd, hComboEx, hCombo, hList, hEdit);
     ok(GetFocus() == hComboExParentWnd,
        "Focus not on Main Window, instead on %p\n", GetFocus());
 
index dc75f9c..1a21f84 100644 (file)
@@ -145,8 +145,6 @@ static LRESULT WINAPI datetime_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
     LRESULT ret;
     struct message msg;
 
-    trace("datetime: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
     msg.message = message;
     msg.flags = sent|wparam|lparam;
     if (defwndproc_counter) msg.flags |= defwinproc;
index ca34e41..1502970 100644 (file)
@@ -412,7 +412,6 @@ static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wPara
     LRESULT ret;
     struct message msg;
 
-    trace("header: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
     msg.message = message;
     msg.flags = sent|wparam|lparam;
     if (defwndproc_counter) msg.flags |= defwinproc;
@@ -444,8 +443,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
         message != WM_DEVICECHANGE)
 
     {
-        trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
         msg.message = message;
         msg.flags = sent|wparam|lparam;
         if (defwndproc_counter) msg.flags |= defwinproc;
index 7559806..53b4fac 100644 (file)
@@ -30,7 +30,6 @@
 
 //#include <stdarg.h>
 #include <stdio.h>
-#include <assert.h>
 
 #include <windef.h>
 #include <winbase.h>
@@ -655,26 +654,26 @@ static struct my_IStream *impl_from_IStream(IStream *iface)
 static HRESULT STDMETHODCALLTYPE Test_Stream_QueryInterface(IStream *iface, REFIID riid,
                                                             void **ppvObject)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static ULONG STDMETHODCALLTYPE Test_Stream_AddRef(IStream *iface)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return 2;
 }
 
 static ULONG STDMETHODCALLTYPE Test_Stream_Release(IStream *iface)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return 1;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Read(IStream *iface, void *pv, ULONG cb,
                                                   ULONG *pcbRead)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
@@ -707,13 +706,13 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_Write(IStream *iface, const void *p
 static HRESULT STDMETHODCALLTYPE Test_Stream_Seek(IStream *iface, LARGE_INTEGER dlibMove,
                                                   DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
@@ -721,46 +720,46 @@ static HRESULT STDMETHODCALLTYPE Test_Stream_CopyTo(IStream *iface, IStream *pst
                                                     ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead,
                                                     ULARGE_INTEGER *pcbWritten)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Commit(IStream *iface, DWORD grfCommitFlags)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Revert(IStream *iface)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_LockRegion(IStream *iface, ULARGE_INTEGER libOffset,
                                                         ULARGE_INTEGER cb, DWORD dwLockType)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset,
                                                           ULARGE_INTEGER cb, DWORD dwLockType)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Stat(IStream *iface, STATSTG *pstatstg,
                                                   DWORD grfStatFlag)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
 static HRESULT STDMETHODCALLTYPE Test_Stream_Clone(IStream *iface, IStream **ppstm)
 {
-    assert(0);
+    ok(0, "unexpected call\n");
     return E_NOTIMPL;
 }
 
index 62b9b77..014997e 100644 (file)
@@ -398,8 +398,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
         message != WM_GETICON &&
         message != WM_DEVICECHANGE)
     {
-        trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
         add_message(sequences, PARENT_SEQ_INDEX, &msg);
         add_message(sequences, COMBINED_SEQ_INDEX, &msg);
     }
@@ -586,8 +584,6 @@ static LRESULT WINAPI listview_subclass_proc(HWND hwnd, UINT message, WPARAM wPa
     LRESULT ret;
     struct message msg;
 
-    trace("listview: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
     /* some debug output for style changing */
     if ((message == WM_STYLECHANGING ||
          message == WM_STYLECHANGED) && lParam)
@@ -664,8 +660,6 @@ static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message, WPARAM wPara
     LRESULT ret;
     struct message msg;
 
-    trace("header: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
     msg.message = message;
     msg.flags = sent|wparam|lparam;
     if (defwndproc_counter) msg.flags |= defwinproc;
@@ -1757,8 +1751,8 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
     if(msg == WM_NOTIFY) {
         NMHDR *nmhdr = (PVOID)lp;
         if(nmhdr->code == NM_CUSTOMDRAW) {
-            NMLVCUSTOMDRAW *nmlvcd = (PVOID)nmhdr;
-            trace("NMCUSTOMDRAW (0x%.8x)\n", nmlvcd->nmcd.dwDrawStage);
+            NMLVCUSTOMDRAW *nmlvcd = (NMLVCUSTOMDRAW*)nmhdr;
+
             switch(nmlvcd->nmcd.dwDrawStage) {
             case CDDS_PREPAINT:
                 SetBkColor(nmlvcd->nmcd.hdc, c0ffee);
index 72dcc66..c1f4e1c 100644 (file)
@@ -22,6 +22,7 @@
 //#include <windows.h>
 
 #include <wine/test.h>
+#include "v6util.h"
 
 static PVOID (WINAPI * pAlloc)(LONG);
 static PVOID (WINAPI * pReAlloc)(PVOID, LONG);
@@ -186,13 +187,39 @@ static void test_Alloc(void)
     ok(res == TRUE, "Expected TRUE, got %d\n", res);
 }
 
+static void test_TaskDialogIndirect(void)
+{
+    HINSTANCE hinst;
+    void *ptr, *ptr2;
+
+    hinst = LoadLibraryA("comctl32.dll");
+
+    ptr = GetProcAddress(hinst, "TaskDialogIndirect");
+    if (!ptr)
+    {
+        win_skip("TaskDialogIndirect not exported by name\n");
+        return;
+    }
+
+    ptr2 = GetProcAddress(hinst, (const CHAR*)345);
+    ok(ptr == ptr2, "got wrong pointer for ordinal 345, %p expected %p\n", ptr2, ptr);
+}
+
 START_TEST(misc)
 {
+    ULONG_PTR ctx_cookie;
+    HANDLE hCtx;
+
     if(!InitFunctionPtrs())
         return;
 
     test_GetPtrAW();
     test_Alloc();
 
-    FreeLibrary(hComctl32);
+    if (!load_v6_module(&ctx_cookie, &hCtx))
+        return;
+
+    test_TaskDialogIndirect();
+
+    unload_v6_module(ctx_cookie, hCtx);
 }
index 1d8ccfa..54a982e 100644 (file)
@@ -461,8 +461,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
         message != WM_GETICON &&
         message != WM_DEVICECHANGE)
     {
-        trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
         msg.message = message;
         msg.flags = sent|wparam|lparam;
         if (defwndproc_counter) msg.flags |= defwinproc;
@@ -883,7 +881,6 @@ static void test_firstDay(void)
     /* check for locale first day */
     if(GetLocaleInfoA(lcid, LOCALE_IFIRSTDAYOFWEEK, b, 128)){
         fday = atoi(b);
-        trace("fday: %d\n", fday);
         res = SendMessage(hwnd, MCM_GETFIRSTDAYOFWEEK, 0, 0);
         expect(fday, res);
         prev = fday;
@@ -1330,6 +1327,9 @@ static void test_scroll(void)
 
     hwnd = create_monthcal_control(0);
 
+    res = SendMessage(hwnd, MCM_GETMONTHDELTA, 0, 0);
+    expect(2, res);
+
     flush_sequences(sequences, NUM_MSG_SEQUENCES);
 
     /* Setter and Getters for scroll rate */
@@ -1977,7 +1977,6 @@ static void test_sel_notify(void)
 
     for(i = 0; i < sizeof styles / sizeof styles[0]; i++)
     {
-        trace("%s\n", styles[i].name);
         hwnd = create_monthcal_control(styles[i].val);
         SetWindowLongPtr(hwnd, GWLP_ID, SEL_NOTIFY_TEST_ID);
         assert(hwnd);
index 21f619b..3d5a32e 100644 (file)
@@ -77,8 +77,6 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
         message != WM_GETICON &&
         message != WM_DEVICECHANGE)
     {
-        trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
         msg.message = message;
         msg.flags = sent|wparam|lparam|parent;
         if (defwndproc_counter) msg.flags |= defwinproc;
@@ -127,8 +125,6 @@ static LRESULT WINAPI pager_subclass_proc(HWND hwnd, UINT message, WPARAM wParam
     WNDPROC oldproc = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_USERDATA);
     struct message msg;
 
-    trace("pager: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
     msg.message = message;
     msg.flags = sent|wparam|lparam;
     msg.wParam = wParam;
index 3083e8b..59a4b00 100644 (file)
 static HWND hProgressParentWnd, hProgressWnd;
 static const char progressTestClass[] = "ProgressBarTestClass";
 
+static HWND create_progress(DWORD style)
+{
+    return CreateWindowExA(0, PROGRESS_CLASSA, "", WS_VISIBLE | style,
+      0, 0, 100, 20, NULL, NULL, GetModuleHandleA(NULL), 0);
+}
 
 /* try to make sure pending X events have been processed before continuing */
 static void flush_events(void)
@@ -224,12 +229,40 @@ static void test_redraw(void)
     ok(erased, "Progress bar should have erased the background\n");
 }
 
+static void test_setcolors(void)
+{
+    HWND progress;
+    COLORREF clr;
+
+    progress = create_progress(PBS_SMOOTH);
+
+    clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, 0);
+    ok(clr == CLR_DEFAULT, "got %x\n", clr);
+
+    clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, RGB(0, 255, 0));
+    ok(clr == 0, "got %x\n", clr);
+
+    clr = SendMessageA(progress, PBM_SETBARCOLOR, 0, CLR_DEFAULT);
+    ok(clr == RGB(0, 255, 0), "got %x\n", clr);
+
+    clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, 0);
+    ok(clr == CLR_DEFAULT, "got %x\n", clr);
+
+    clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, RGB(255, 0, 0));
+    ok(clr == 0, "got %x\n", clr);
+
+    clr = SendMessageA(progress, PBM_SETBKCOLOR, 0, CLR_DEFAULT);
+    ok(clr == RGB(255, 0, 0), "got %x\n", clr);
+
+    DestroyWindow(progress);
+}
 
 START_TEST(progress)
 {
     init();
     
     test_redraw();
-    
+    test_setcolors();
+
     cleanup();
 }
index 35373ad..387c9a7 100644 (file)
@@ -669,8 +669,6 @@ static void save_message(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam,
         (message < WM_MOUSEFIRST || message > WM_MOUSEHWHEEL) &&
         message != 0x90)
     {
-        /*trace("check_message: %04x, %04x\n", message, receiver);*/
-
         msg.message = message;
         msg.flags = sent|wparam|lparam|id;
         msg.wParam = wParam;
index a608603..f85d092 100644 (file)
@@ -126,7 +126,9 @@ static HWND build_toolbar(int nr, HWND hParent)
     return hToolbar;
 }
 
-static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static int g_parent_measureitem;
+
+static LRESULT CALLBACK parent_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 {
     switch (msg)
     {
@@ -137,6 +139,9 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
                     GetClientRect(lpnm->hwndFrom, &height_change_notify_rect);
             }
             break;
+        case WM_MEASUREITEM:
+            g_parent_measureitem++;
+            break;
     }
     return DefWindowProcA(hWnd, msg, wParam, lParam);
 }
@@ -1058,7 +1063,7 @@ static BOOL register_parent_wnd_class(void)
     wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
     wc.lpszMenuName = NULL;
     wc.lpszClassName = "MyTestWnd";
-    wc.lpfnWndProc = MyWndProc;
+    wc.lpfnWndProc = parent_wndproc;
 
     return RegisterClassA(&wc);
 }
@@ -1108,6 +1113,20 @@ static void test_showband(void)
     DestroyWindow(hRebar);
 }
 
+static void test_notification(void)
+{
+    MEASUREITEMSTRUCT mis;
+    HWND rebar;
+
+    rebar = create_rebar_control();
+
+    g_parent_measureitem = 0;
+    SendMessageA(rebar, WM_MEASUREITEM, 0, (LPARAM)&mis);
+    ok(g_parent_measureitem == 1, "got %d\n", g_parent_measureitem);
+
+    DestroyWindow(rebar);
+}
+
 START_TEST(rebar)
 {
     HMODULE hComctl32;
@@ -1134,6 +1153,7 @@ START_TEST(rebar)
     test_bandinfo();
     test_colors();
     test_showband();
+    test_notification();
 
     if(!is_font_installed("System") || !is_font_installed("Tahoma"))
     {
index aa0d65f..92d224c 100644 (file)
@@ -394,6 +394,7 @@ static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LP
         if (defwndproc_counter) msg.flags |= defwinproc;
         msg.wParam = wParam;
         msg.lParam = lParam;
+        msg.id = 0;
         add_message(sequences, PARENT_SEQ_INDEX, &msg);
     }