Author: gadamopoulos
Date: Sat Feb 25 22:12:08 2017
New Revision: 73912
URL:
http://svn.reactos.org/svn/reactos?rev=73912&view=rev
Log:
[COMCTL32] -Test BCM_SETTEXTMARGIN, BCM_SETIMAGELIST, BCM_GETIMAGELIST and
BCM_GETTEXTMARGIN for the v6 button.
Added:
trunk/rostests/apitests/comctl32/
trunk/rostests/apitests/comctl32/CMakeLists.txt (with props)
trunk/rostests/apitests/comctl32/button.c (with props)
trunk/rostests/apitests/comctl32/comctl32_apitest.rc (with props)
trunk/rostests/apitests/comctl32/testlist.c (with props)
Modified:
trunk/rostests/apitests/CMakeLists.txt
Modified: trunk/rostests/apitests/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?r…
==============================================================================
--- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Sat Feb 25 22:12:08 2017
@@ -6,6 +6,7 @@
add_subdirectory(atl)
add_subdirectory(browseui)
add_subdirectory(com)
+add_subdirectory(comctl32)
add_subdirectory(crt)
add_subdirectory(dbghelp)
add_subdirectory(dciman32)
Added: trunk/rostests/apitests/comctl32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/CMakeLi…
==============================================================================
--- trunk/rostests/apitests/comctl32/CMakeLists.txt (added)
+++ trunk/rostests/apitests/comctl32/CMakeLists.txt [iso-8859-1] Sat Feb 25 22:12:08 2017
@@ -0,0 +1,6 @@
+
+add_executable(comctl32_apitest button.c testlist.c comctl32_apitest.rc)
+target_link_libraries(comctl32_apitest wine)
+set_module_type(comctl32_apitest win32cui)
+add_importlibs(comctl32_apitest user32 msvcrt kernel32 ntdll)
+add_rostests_file(TARGET comctl32_apitest)
Propchange: trunk/rostests/apitests/comctl32/CMakeLists.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/comctl32/button.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/button.…
==============================================================================
--- trunk/rostests/apitests/comctl32/button.c (added)
+++ trunk/rostests/apitests/comctl32/button.c [iso-8859-1] Sat Feb 25 22:12:08 2017
@@ -0,0 +1,90 @@
+/*
+ * PROJECT: ReactOS api tests
+ * LICENSE: GPL - See COPYING in the top level directory
+ * PURPOSE: Test for Button window class v6
+ * PROGRAMMERS: Giannis Adamopoulos
+ */
+
+#include "wine/test.h"
+#include <windows.h>
+#include <commctrl.h>
+
+#define ok_rect(rc, l,r,t,b) ok((rc.left == (l)) && (rc.right == (r)) &&
(rc.top == (t)) && (rc.bottom == (b)), "Wrong rect. expected %d, %d, %d, %d
got %ld, %ld, %ld, %ld\n", l,t,r,b, rc.left, rc.top, rc.right, rc.bottom)
+
+void Test_TextMargin()
+{
+ RECT rc;
+ BOOL ret;
+ HWND hwnd1;
+
+ hwnd1 = CreateWindowW(L"Button", L"Test1", 0, 10, 10, 100, 100,
0, NULL, NULL, NULL);
+ ok (hwnd1 != NULL, "Expected CreateWindowW to succeed\n");
+
+ ret = SendMessageW(hwnd1, BCM_GETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_GETTEXTMARGIN to succeed\n");
+ ok_rect(rc, 1, 1, 1, 1);
+
+ SetRect(&rc, 0,0,0,0);
+ ret = SendMessageW(hwnd1, BCM_SETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_SETTEXTMARGIN to succeed\n");
+
+ ret = SendMessageW(hwnd1, BCM_GETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_GETTEXTMARGIN to succeed\n");
+ ok_rect(rc, 0, 0, 0, 0);
+
+ SetRect(&rc, -1,-1,-1,-1);
+ ret = SendMessageW(hwnd1, BCM_SETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_SETTEXTMARGIN to succeed\n");
+
+ ret = SendMessageW(hwnd1, BCM_GETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_GETTEXTMARGIN to succeed\n");
+ ok_rect(rc, -1, -1, -1, -1);
+
+ SetRect(&rc, 1000,1000,1000,1000);
+ ret = SendMessageW(hwnd1, BCM_SETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_SETTEXTMARGIN to succeed\n");
+
+ ret = SendMessageW(hwnd1, BCM_GETTEXTMARGIN, 0, (LPARAM)&rc);
+ ok (ret == TRUE, "Expected BCM_GETTEXTMARGIN to succeed\n");
+ ok_rect(rc, 1000, 1000, 1000, 1000);
+
+ DestroyWindow(hwnd1);
+}
+
+void Test_Imagelist()
+{
+ HWND hwnd1;
+ BOOL ret;
+ BUTTON_IMAGELIST imlData;
+
+ hwnd1 = CreateWindowW(L"Button", L"Test2", 0, 10, 10, 100, 100,
0, NULL, NULL, NULL);
+ ok (hwnd1 != NULL, "Expected CreateWindowW to succeed\n");
+
+ ret = SendMessageW(hwnd1, BCM_GETIMAGELIST, 0, (LPARAM)&imlData);
+ ok (ret == TRUE, "Expected BCM_GETIMAGELIST to succeed\n");
+ ok (imlData.himl == 0, "Expected 0 himl\n");
+ ok (imlData.uAlign == 0, "Expected 0 uAlign\n");
+ ok_rect(imlData.margin, 0, 0, 0, 0);
+
+ SetRect(&imlData.margin, 0,0,0,1);
+ ret = SendMessageW(hwnd1, BCM_SETIMAGELIST, 0, (LPARAM)&imlData);
+ ok (ret == FALSE, "Expected BCM_SETIMAGELIST to fail\n"); /* This works in
win10 */
+
+ imlData.himl = (HIMAGELIST)0xdead;
+ ret = SendMessageW(hwnd1, BCM_SETIMAGELIST, 0, (LPARAM)&imlData);
+ ok (ret == TRUE, "Expected BCM_SETIMAGELIST to fail\n"); /* This works in
win10 */
+
+ ret = SendMessageW(hwnd1, BCM_GETIMAGELIST, 0, (LPARAM)&imlData);
+ ok (ret == TRUE, "Expected BCM_GETIMAGELIST to succeed\n");
+ ok (imlData.himl == (HIMAGELIST)0xdead, "Expected 0 himl\n");
+ ok (imlData.uAlign == 0, "Expected 0 uAlign\n");
+ ok_rect(imlData.margin, 0, 0, 0, 1);
+}
+
+START_TEST(button)
+{
+ LoadLibraryW(L"comctl32.dll"); /* same as statically linking to comctl32
and doing InitCommonControls */
+ Test_TextMargin();
+ Test_Imagelist();
+}
+
Propchange: trunk/rostests/apitests/comctl32/button.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/comctl32/comctl32_apitest.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/comctl3…
==============================================================================
--- trunk/rostests/apitests/comctl32/comctl32_apitest.rc (added)
+++ trunk/rostests/apitests/comctl32/comctl32_apitest.rc [iso-8859-1] Sat Feb 25 22:12:08
2017
@@ -0,0 +1,7 @@
+#include <windef.h>
+#include <winuser.h>
+#include <dlgs.h>
+
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+
+#include <reactos/manifest_exe.rc>
Propchange: trunk/rostests/apitests/comctl32/comctl32_apitest.rc
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/rostests/apitests/comctl32/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/comctl32/testlis…
==============================================================================
--- trunk/rostests/apitests/comctl32/testlist.c (added)
+++ trunk/rostests/apitests/comctl32/testlist.c [iso-8859-1] Sat Feb 25 22:12:08 2017
@@ -0,0 +1,10 @@
+#define STANDALONE
+#include <apitest.h>
+
+extern void func_button(void);
+
+const struct test winetest_testlist[] =
+{
+ { "button", func_button },
+ { 0, 0 }
+};
Propchange: trunk/rostests/apitests/comctl32/testlist.c
------------------------------------------------------------------------------
svn:eol-style = native