user32/tests: Fix a test in edit.c that was not testing what it was supposed to test.
This commit is contained in:
parent
925b1448bc
commit
3e7f226985
|
@ -1177,9 +1177,13 @@ static void test_edit_control_4(void)
|
||||||
static void test_edit_control_5(void)
|
static void test_edit_control_5(void)
|
||||||
{
|
{
|
||||||
static const char *str = "test\r\ntest";
|
static const char *str = "test\r\ntest";
|
||||||
|
HWND parentWnd;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
int len;
|
int len;
|
||||||
|
RECT rc1 = { 10, 10, 11, 11};
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
/* first show that a non-child won't do for this test */
|
||||||
hWnd = CreateWindowEx(0,
|
hWnd = CreateWindowEx(0,
|
||||||
"EDIT",
|
"EDIT",
|
||||||
str,
|
str,
|
||||||
|
@ -1187,19 +1191,48 @@ static void test_edit_control_5(void)
|
||||||
10, 10, 1, 1,
|
10, 10, 1, 1,
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
assert(hWnd);
|
assert(hWnd);
|
||||||
|
/* size of non-child edit control is (much) bigger then requested */
|
||||||
|
GetWindowRect( hWnd, &rc);
|
||||||
|
ok( rc.right - rc.left > 20, "size of the window (%d) is smaller then expected\n",
|
||||||
|
rc.right - rc.left);
|
||||||
|
DestroyWindow(hWnd);
|
||||||
|
/* so create a parent, and give it edit controls children to test with */
|
||||||
|
parentWnd = CreateWindowEx(0,
|
||||||
|
szEditTextPositionClass,
|
||||||
|
"Edit Test", WS_VISIBLE |
|
||||||
|
WS_OVERLAPPEDWINDOW,
|
||||||
|
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||||
|
250, 250,
|
||||||
|
NULL, NULL, hinst, NULL);
|
||||||
|
assert(parentWnd);
|
||||||
|
ShowWindow( parentWnd, SW_SHOW);
|
||||||
|
/* single line */
|
||||||
|
hWnd = CreateWindowEx(0,
|
||||||
|
"EDIT",
|
||||||
|
str, WS_VISIBLE | WS_BORDER |
|
||||||
|
WS_CHILD,
|
||||||
|
rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top,
|
||||||
|
parentWnd, NULL, NULL, NULL);
|
||||||
|
assert(hWnd);
|
||||||
|
GetClientRect( hWnd, &rc);
|
||||||
|
ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top,
|
||||||
|
"Client rectangle not the expected size (%d,%d,%d,%d)\n",
|
||||||
|
rc.left, rc.top, rc.right, rc.bottom);
|
||||||
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||||
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
|
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
|
/* multi line */
|
||||||
hWnd = CreateWindowEx(0,
|
hWnd = CreateWindowEx(0,
|
||||||
"EDIT",
|
"EDIT",
|
||||||
str,
|
str,
|
||||||
ES_MULTILINE,
|
WS_CHILD | ES_MULTILINE,
|
||||||
10, 10, 1, 1,
|
rc1.left, rc1.top, rc1.right - rc1.left, rc1.bottom - rc1.top,
|
||||||
NULL, NULL, NULL, NULL);
|
parentWnd, NULL, NULL, NULL);
|
||||||
assert(hWnd);
|
assert(hWnd);
|
||||||
|
GetClientRect( hWnd, &rc);
|
||||||
|
ok( rc.right == rc1.right - rc1.left && rc.bottom == rc1.bottom - rc1.top,
|
||||||
|
"Client rectangle not the expected size (%d,%d,%d,%d)\n",
|
||||||
|
rc.left, rc.top, rc.right, rc.bottom);
|
||||||
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0);
|
||||||
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
|
ok(lstrlenA(str) == len, "text shouldn't have been truncated\n");
|
||||||
DestroyWindow(hWnd);
|
DestroyWindow(hWnd);
|
||||||
|
|
Loading…
Reference in New Issue