mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[COMCTL32] -Test BCM_SETTEXTMARGIN, BCM_SETIMAGELIST, BCM_GETIMAGELIST and BCM_GETTEXTMARGIN for the v6 button.
svn path=/trunk/; revision=73912
This commit is contained in:
parent
0368cd40fa
commit
7483cbb904
5 changed files with 114 additions and 0 deletions
|
@ -6,6 +6,7 @@ add_subdirectory(appshim)
|
|||
add_subdirectory(atl)
|
||||
add_subdirectory(browseui)
|
||||
add_subdirectory(com)
|
||||
add_subdirectory(comctl32)
|
||||
add_subdirectory(crt)
|
||||
add_subdirectory(dbghelp)
|
||||
add_subdirectory(dciman32)
|
||||
|
|
6
rostests/apitests/comctl32/CMakeLists.txt
Normal file
6
rostests/apitests/comctl32/CMakeLists.txt
Normal file
|
@ -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)
|
90
rostests/apitests/comctl32/button.c
Normal file
90
rostests/apitests/comctl32/button.c
Normal file
|
@ -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();
|
||||
}
|
||||
|
7
rostests/apitests/comctl32/comctl32_apitest.rc
Normal file
7
rostests/apitests/comctl32/comctl32_apitest.rc
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <windef.h>
|
||||
#include <winuser.h>
|
||||
#include <dlgs.h>
|
||||
|
||||
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||
|
||||
#include <reactos/manifest_exe.rc>
|
10
rostests/apitests/comctl32/testlist.c
Normal file
10
rostests/apitests/comctl32/testlist.c
Normal file
|
@ -0,0 +1,10 @@
|
|||
#define STANDALONE
|
||||
#include <apitest.h>
|
||||
|
||||
extern void func_button(void);
|
||||
|
||||
const struct test winetest_testlist[] =
|
||||
{
|
||||
{ "button", func_button },
|
||||
{ 0, 0 }
|
||||
};
|
Loading…
Reference in a new issue