- Update user32_winetest to Wine-23052006. Update includes changes in the following subtests: edit, winstation. Evereything else is just compilation

svn path=/trunk/; revision=21991
This commit is contained in:
Aleksey Bragin 2006-05-23 19:55:45 +00:00
parent 9eda943d76
commit f2725683f8
4 changed files with 6 additions and 148 deletions

View file

@ -20,6 +20,7 @@
#include <assert.h> #include <assert.h>
#include <windows.h> #include <windows.h>
#include <windowsx.h>
#include <commctrl.h> #include <commctrl.h>
#include "wine/test.h" #include "wine/test.h"
@ -277,9 +278,7 @@ static void ET2_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
static LRESULT CALLBACK ET2_WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) static LRESULT CALLBACK ET2_WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{ {
switch (iMsg) { switch (iMsg) {
case WM_COMMAND: HANDLE_MSG(hwnd, WM_COMMAND, ET2_OnCommand);
ET2_OnCommand(hwnd, LOWORD(wParam), (HWND)lParam, HIWORD(wParam));
break;
} }
return DefWindowProc(hwnd, iMsg, wParam, lParam); return DefWindowProc(hwnd, iMsg, wParam, lParam);
} }
@ -764,104 +763,6 @@ static void test_margins(void)
DestroyWindow (hwEdit); DestroyWindow (hwEdit);
} }
static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam)
{
return 0;
}
static void test_margins_font_change(void)
{
HWND hwEdit;
DWORD margins, font_margins;
LOGFONT lf;
HFONT hfont, hfont2;
HDC hdc = GetDC(0);
if(EnumFontFamiliesA(hdc, "Arial", find_font_proc, 0))
{
trace("Arial not found - skipping font change margin tests\n");
ReleaseDC(0, hdc);
return;
}
ReleaseDC(0, hdc);
hwEdit = create_child_editcontrol(0, 0);
SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE);
memset(&lf, 0, sizeof(lf));
strcpy(lf.lfFaceName, "Arial");
lf.lfHeight = 16;
lf.lfCharSet = DEFAULT_CHARSET;
hfont = CreateFontIndirectA(&lf);
lf.lfHeight = 30;
hfont2 = CreateFontIndirectA(&lf);
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
font_margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(font_margins) != 0, "got %d\n", LOWORD(font_margins));
ok(HIWORD(font_margins) != 0, "got %d\n", HIWORD(font_margins));
/* With 'small' edit controls, test that the margin doesn't get set */
SetWindowPos(hwEdit, NULL, 10, 10, 16, 100, SWP_NOZORDER | SWP_NOACTIVATE);
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 0, "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins));
/* Above a certain size threshold then the margin is updated */
SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE);
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO));
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) == LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0);
margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0);
ok(LOWORD(margins) != LOWORD(font_margins), "got %d\n", LOWORD(margins));
ok(HIWORD(margins) != HIWORD(font_margins), "got %d\n", HIWORD(margins));
SendMessageA(hwEdit, WM_SETFONT, 0, 0);
DeleteObject(hfont2);
DeleteObject(hfont);
destroy_child_editcontrol(hwEdit);
}
#define edit_pos_ok(exp, got, txt) \ #define edit_pos_ok(exp, got, txt) \
ok(exp == got, "wrong " #txt " expected %d got %ld\n", exp, got); ok(exp == got, "wrong " #txt " expected %d got %ld\n", exp, got);
@ -1066,7 +967,6 @@ START_TEST(edit)
test_edit_control_4(); test_edit_control_4();
test_edit_control_5(); test_edit_control_5();
test_margins(); test_margins();
test_margins_font_change();
test_text_position(); test_text_position();
UnregisterWindowClasses(); UnregisterWindowClasses();

View file

@ -49,7 +49,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
#include "windows.h" #include "windef.h"
#include "wine/test.h" #include "wine/test.h"

View file

@ -2316,7 +2316,6 @@ static void test_keyboard_input(HWND hwnd)
ShowWindow(hwnd, SW_SHOW); ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd); UpdateWindow(hwnd);
flush_events();
ok(GetActiveWindow() == hwnd, "wrong active window %p\n", GetActiveWindow()); ok(GetActiveWindow() == hwnd, "wrong active window %p\n", GetActiveWindow());

View file

@ -42,29 +42,12 @@ static void print_object( HANDLE obj )
trace( "obj %p type '%s'\n", obj, buffer ); trace( "obj %p type '%s'\n", obj, buffer );
} }
static void register_class(void)
{
WNDCLASSA cls;
cls.style = CS_DBLCLKS;
cls.lpfnWndProc = DefWindowProcA;
cls.cbClsExtra = 0;
cls.cbWndExtra = 0;
cls.hInstance = GetModuleHandleA(0);
cls.hIcon = 0;
cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW);
cls.hbrBackground = GetStockObject(WHITE_BRUSH);
cls.lpszMenuName = NULL;
cls.lpszClassName = "WinStationClass";
RegisterClassA(&cls);
}
static HDESK initial_desktop; static HDESK initial_desktop;
static DWORD CALLBACK thread( LPVOID arg ) static DWORD CALLBACK thread( LPVOID arg )
{ {
HDESK d1, d2; HDESK d1, d2;
HWND hwnd = CreateWindowExA(0,"WinStationClass","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0); HWND hwnd = CreateWindowExA(0,"BUTTON","test",WS_POPUP,0,0,100,100,GetDesktopWindow(),0,0,0);
ok( hwnd != 0, "CreateWindow failed\n" ); ok( hwnd != 0, "CreateWindow failed\n" );
d1 = GetThreadDesktop(GetCurrentThreadId()); d1 = GetThreadDesktop(GetCurrentThreadId());
trace( "thread %p desktop: %p\n", arg, d1 ); trace( "thread %p desktop: %p\n", arg, d1 );
@ -106,8 +89,6 @@ static void test_handles(void)
HDESK d1, d2, d3; HDESK d1, d2, d3;
HANDLE hthread; HANDLE hthread;
DWORD id, flags; DWORD id, flags;
ATOM atom;
char buffer[20];
/* win stations */ /* win stations */
@ -163,28 +144,6 @@ static void test_handles(void)
w3 = OpenWindowStation("foobar", TRUE, WINSTA_ALL_ACCESS ); w3 = OpenWindowStation("foobar", TRUE, WINSTA_ALL_ACCESS );
ok( !w3, "open foobar station succeeded\n" ); ok( !w3, "open foobar station succeeded\n" );
w2 = CreateWindowStation("foobar1", 0, WINSTA_ALL_ACCESS, NULL );
ok( w2 != 0, "create foobar station failed\n" );
w3 = CreateWindowStation("foobar2", 0, WINSTA_ALL_ACCESS, NULL );
ok( w3 != 0, "create foobar station failed\n" );
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
ok( GetHandleInformation( w3, &flags ), "GetHandleInformation failed\n" );
SetProcessWindowStation( w2 );
register_class();
atom = GlobalAddAtomA("foo");
ok( GlobalGetAtomNameA( atom, buffer, sizeof(buffer) ) == 3, "GlobalGetAtomName failed\n" );
ok( !lstrcmpiA( buffer, "foo" ), "bad atom value %s\n", buffer );
ok( !CloseWindowStation( w2 ), "CloseWindowStation succeeded\n" );
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
SetProcessWindowStation( w3 );
ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" );
ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" );
ok( GlobalGetAtomNameA( atom, buffer, sizeof(buffer) ) == 3, "GlobalGetAtomName failed\n" );
ok( !lstrcmpiA( buffer, "foo" ), "bad atom value %s\n", buffer );
/* desktops */ /* desktops */
d1 = GetThreadDesktop(GetCurrentThreadId()); d1 = GetThreadDesktop(GetCurrentThreadId());
initial_desktop = d1; initial_desktop = d1;