[KMTestSuite]

- Sync to rostests r53632

svn path=/branches/GSoC_2011/KMTestSuite/; revision=53638
This commit is contained in:
Thomas Faber
2011-09-08 10:28:02 +00:00
21 changed files with 156 additions and 4 deletions
+1
View File
@@ -14,6 +14,7 @@ list(APPEND SOURCE
ScrollDC.c
ScrollWindowEx.c
SetCursorPos.c
SetActiveWindow.c
WndProc.c
testlist.c
user32_apitest.rc)
+92
View File
@@ -0,0 +1,92 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for SetActiveWindow
* PROGRAMMERS: Giannis Adamopoulos
*/
#include <stdio.h>
#include <wine/test.h>
#include <windows.h>
#define EXPECT_NEXT(hWnd1, hWnd2) ok(GetWindow(hWnd1,GW_HWNDNEXT) == hWnd2, "Expected %p after %p, not %p\n",hWnd2,hWnd1,GetWindow(hWnd1,GW_HWNDNEXT) )
#define EXPECT_ACTIVE(hwnd) ok(GetActiveWindow() == hwnd, "Expected %p to be the active window, not %p\n",hwnd,GetActiveWindow())
void Test_SetActiveWindow()
{
MSG msg;
HWND hWnd1, hWnd2, hWnd3, hWnd4;
hWnd1 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW,
20, 20, 300, 300, NULL, NULL, 0, NULL);
hWnd2 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW,
20, 350, 300, 300, hWnd1, NULL, 0, NULL);
hWnd3 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW,
200, 200, 300, 300, NULL, NULL, 0, NULL);
hWnd4 = CreateWindowW(L"BUTTON", L"ownertest", WS_OVERLAPPEDWINDOW,
250, 250, 200, 200, hWnd1, NULL, 0, NULL);
ShowWindow(hWnd1, SW_SHOW);
UpdateWindow(hWnd1);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd4,hWnd2);
EXPECT_NEXT(hWnd1,hWnd3);
ShowWindow(hWnd2, SW_SHOW);
UpdateWindow(hWnd2);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd2,hWnd4);
EXPECT_NEXT(hWnd4,hWnd1);
ShowWindow(hWnd3, SW_SHOW);
UpdateWindow(hWnd3);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd3,hWnd2);
EXPECT_NEXT(hWnd2,hWnd4);
EXPECT_NEXT(hWnd4,hWnd1);
ShowWindow(hWnd4, SW_SHOW);
UpdateWindow(hWnd4);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd4,hWnd2);
EXPECT_NEXT(hWnd2,hWnd1);
EXPECT_NEXT(hWnd1,hWnd3);
EXPECT_ACTIVE(hWnd4);
SetActiveWindow(hWnd1);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd4,hWnd2);
EXPECT_NEXT(hWnd2,hWnd1);
EXPECT_NEXT(hWnd1,hWnd3);
EXPECT_ACTIVE(hWnd1);
SetActiveWindow(hWnd3);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd3,hWnd4);
EXPECT_NEXT(hWnd4,hWnd2);
EXPECT_NEXT(hWnd2,hWnd1);
EXPECT_ACTIVE(hWnd3);
SetActiveWindow(hWnd2);
while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
EXPECT_NEXT(hWnd2,hWnd4);
EXPECT_NEXT(hWnd4,hWnd1);
EXPECT_NEXT(hWnd1,hWnd3);
EXPECT_ACTIVE(hWnd2);
}
START_TEST(SetActiveWindow)
{
Test_SetActiveWindow();
}
+2
View File
@@ -15,6 +15,7 @@ extern void func_GetPeekMessage(void);
extern void func_DeferWindowPos(void);
extern void func_GetKeyState(void);
extern void func_SetCursorPos(void);
extern void func_SetActiveWindow(void);
extern void func_WndProc(void);
const struct test winetest_testlist[] =
@@ -29,6 +30,7 @@ const struct test winetest_testlist[] =
{ "DeferWindowPos", func_DeferWindowPos },
{ "GetKeyState", func_GetKeyState },
{ "SetCursorPos", func_SetCursorPos },
{ "SetActiveWindow", func_SetActiveWindow },
{ "WndProc", func_WndProc },
{ 0, 0 }
};
+1
View File
@@ -19,6 +19,7 @@
<file>GetIconInfo.c</file>
<file>GetPeekMessage.c</file>
<file>DeferWindowPos.c</file>
<file>SetActiveWindow.c</file>
<file>SetCursorPos.c</file>
<file>WndProc.c</file>
+4
View File
@@ -6,3 +6,7 @@ target_link_libraries(pseh2_test wine ${PSEH_LIB})
set_module_type(pseh2_test win32cui)
add_importlibs(pseh2_test msvcrt kernel32 ntdll)
add_cd_file(TARGET pseh2_test DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(pseh2_test)
endif()
+2
View File
@@ -39,6 +39,8 @@ target_link_libraries(comctl32_winetest wine)
if(MSVC)
target_link_libraries(comctl32_winetest uuid)
else()
allow_warnings(comctl32_winetest)
endif()
set_module_type(comctl32_winetest win32cui)
+4
View File
@@ -15,3 +15,7 @@ target_link_libraries(fusion_winetest wine)
set_module_type(fusion_winetest win32cui)
add_importlibs(fusion_winetest user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET fusion_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(fusion_winetest)
endif()
+2
View File
@@ -3,6 +3,8 @@ add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
list(APPEND SOURCE
bitmap.c
brush.c
+4 -3
View File
@@ -1427,14 +1427,15 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits,
const ENHMETARECORD *emr1 = (const ENHMETARECORD *)(bits + offset1);
const ENHMETARECORD *emr2 = (const ENHMETARECORD *)(buf + offset2);
#if 1
if(!winetest_interactive)
skip("skipping match_emf_record(), bug 5393\n");
#else
else
{
trace("%s: EMF record %u, size %u/record %u, size %u\n",
desc, emr1->iType, emr1->nSize, emr2->iType, emr2->nSize);
if (!match_emf_record(emr1, emr2, desc, ignore_scaling)) return -1;
#endif
}
/* We have already bailed out if iType or nSize don't match */
offset1 += emr1->nSize;
+5
View File
@@ -3,6 +3,8 @@ add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
set_rc_compiler()
list(APPEND SOURCE
@@ -48,5 +50,8 @@ add_executable(kernel32_winetest ${SOURCE})
target_link_libraries(kernel32_winetest wine)
set_module_type(kernel32_winetest win32cui)
add_importlibs(kernel32_winetest user32 advapi32 msvcrt kernel32 ntdll)
if(NOT MSVC)
allow_warnings(kernel32_winetest)
endif()
add_cd_file(TARGET kernel32_winetest DESTINATION reactos/bin FOR all)
+2
View File
@@ -24,6 +24,8 @@ add_executable(msvcrt_winetest ${SOURCE})
if(MSVC)
target_link_libraries(msvcrt_winetest oldnames)
else()
allow_warnings(msvcrt_winetest)
endif()
set_module_type(msvcrt_winetest win32cui)
+3
View File
@@ -29,3 +29,6 @@ add_executable(ntdll_winetest ${SOURCE})
set_module_type(ntdll_winetest win32cui)
add_importlibs(ntdll_winetest user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET ntdll_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(ntdll_winetest)
endif()
+4
View File
@@ -8,3 +8,7 @@ add_executable(powrprof_winetest pwrprof.c testlist.c)
set_module_type(powrprof_winetest win32cui)
add_importlibs(powrprof_winetest advapi32 powrprof msvcrt kernel32 ntdll)
add_cd_file(TARGET powrprof_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(powrprof_winetest)
endif()
+6 -1
View File
@@ -1,5 +1,6 @@
remove_definitions(-D_WIN32_WINNT=0x502)
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
add_definitions(-D_WIN32_WINNT=0x500)
add_definitions(
@@ -44,3 +45,7 @@ target_link_libraries(rpcrt4_winetest
set_module_type(rpcrt4_winetest win32cui)
add_importlibs(rpcrt4_winetest ole32 rpcrt4 msvcrt kernel32 ntdll)
add_cd_file(TARGET rpcrt4_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(rpcrt4_winetest)
endif()
+4
View File
@@ -19,3 +19,7 @@ target_link_libraries(setupapi_winetest wine)
set_module_type(setupapi_winetest win32cui)
add_importlibs(setupapi_winetest advapi32 setupapi user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET setupapi_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(setupapi_winetest)
endif()
+4
View File
@@ -15,3 +15,7 @@ target_link_libraries(shdocvw_winetest wine uuid)
set_module_type(shdocvw_winetest win32cui)
add_importlibs(shdocvw_winetest gdi32 shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET shdocvw_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(shdocvw_winetest)
endif()
+2
View File
@@ -1,4 +1,6 @@
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
+4
View File
@@ -38,3 +38,7 @@ target_link_libraries(user32_winetest wine)
set_module_type(user32_winetest win32cui)
add_importlibs(user32_winetest user32 gdi32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET user32_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(user32_winetest)
endif()
+2
View File
@@ -1,4 +1,6 @@
remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502)
add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
+4
View File
@@ -17,3 +17,7 @@ target_link_libraries(winmm_winetest wine dxguid)
set_module_type(winmm_winetest win32cui)
add_importlibs(winmm_winetest winmm user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET winmm_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(winmm_winetest)
endif()
+4
View File
@@ -8,3 +8,7 @@ target_link_libraries(ws2_32_winetest wine)
set_module_type(ws2_32_winetest win32cui)
add_importlibs(ws2_32_winetest ws2_32 user32 msvcrt kernel32 ntdll)
add_cd_file(TARGET ws2_32_winetest DESTINATION reactos/bin FOR all)
if(NOT MSVC)
allow_warnings(ws2_32_winetest)
endif()