Author: gadamopoulos Date: Tue Mar 7 22:29:48 2017 New Revision: 74123
URL: http://svn.reactos.org/svn/reactos?rev=74123&view=rev Log: [USER32_APITEST] -Move the helper functions in the common include directory [UXTHEME_APITEST] -Use the helper functions to test the messages sent by DrawThemeParentBackground
Added: trunk/rostests/apitests/include/msgtrace.c - copied, changed from r74111, trunk/rostests/apitests/user32/helper.c trunk/rostests/apitests/include/msgtrace.h - copied, changed from r74111, trunk/rostests/apitests/user32/helper.h trunk/rostests/apitests/include/user32testhelpers.h (with props) trunk/rostests/apitests/uxtheme/ trunk/rostests/apitests/uxtheme/CMakeLists.txt (with props) trunk/rostests/apitests/uxtheme/DrawThemeParentBackground.c (with props) trunk/rostests/apitests/uxtheme/testlist.c (with props) Removed: trunk/rostests/apitests/user32/helper.c trunk/rostests/apitests/user32/helper.h Modified: trunk/rostests/apitests/CMakeLists.txt trunk/rostests/apitests/user32/AttachThreadInput.c trunk/rostests/apitests/user32/CMakeLists.txt trunk/rostests/apitests/user32/DeferWindowPos.c trunk/rostests/apitests/user32/GetDCEx.c trunk/rostests/apitests/user32/RegisterClassEx.c trunk/rostests/apitests/user32/SendMessageTimeout.c trunk/rostests/apitests/user32/SetActiveWindow.c trunk/rostests/apitests/user32/SetParent.c trunk/rostests/apitests/user32/SetProp.c trunk/rostests/apitests/user32/SystemParametersInfo.c trunk/rostests/apitests/user32/TrackMouseEvent.c trunk/rostests/apitests/user32/desktop.c
Modified: trunk/rostests/apitests/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/CMakeLists.txt?re... ============================================================================== --- trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/CMakeLists.txt [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -34,6 +34,7 @@ add_subdirectory(user32) add_subdirectory(user32_dynamic) add_subdirectory(userenv) +add_subdirectory(uxtheme) if(NOT ARCH STREQUAL "amd64" AND NOT CMAKE_BUILD_TYPE STREQUAL "Release") add_subdirectory(win32kdll) add_subdirectory(win32nt)
Copied: trunk/rostests/apitests/include/msgtrace.c (from r74111, trunk/rostests/apitests/user32/helper.c) URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/include/msgtrace.... ============================================================================== --- trunk/rostests/apitests/user32/helper.c [iso-8859-1] (original) +++ trunk/rostests/apitests/include/msgtrace.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -9,7 +9,7 @@
#include <stdio.h> #include <winuser.h> -#include "helper.h" +#include <msgtrace.h> #include <undocuser.h>
MSG_CACHE default_cache = { @@ -58,6 +58,10 @@ case WM_SETICON: return "WM_SETICON"; case WM_KEYDOWN: return "WM_KEYDOWN"; case WM_KEYUP: return "WM_KEYUP"; + case WM_NOTIFY: return "WM_NOTIFY"; + case WM_COMMAND: return "WM_COMMAND"; + case WM_PRINTCLIENT: return "WM_PRINTCLIENT"; + case WM_CTLCOLORSTATIC: return "WM_CTLCOLORSTATIC"; default: return NULL; } } @@ -203,16 +207,3 @@
cache->count++; } - -ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName) -{ - WNDCLASSEXW wcex; - - memset(&wcex, 0, sizeof(wcex)); - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.lpfnWndProc = lpfnWndProc; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wcex.lpszClassName = lpszClassName; - return RegisterClassExW(&wcex); -}
Copied: trunk/rostests/apitests/include/msgtrace.h (from r74111, trunk/rostests/apitests/user32/helper.h) URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/include/msgtrace.... ============================================================================== --- trunk/rostests/apitests/user32/helper.h [iso-8859-1] (original) +++ trunk/rostests/apitests/include/msgtrace.h [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -1,3 +1,5 @@ +#ifndef APITESTS_MSGTRACE_H +#define APITESTS_MSGTRACE_H
typedef enum _MSG_TYPE { @@ -30,8 +32,6 @@ void compare_cache(MSG_CACHE* cache, const char* file, int line, MSG_ENTRY *msg_chain); void trace_cache(MSG_CACHE* cache, const char* file, int line); void empty_message_cache(MSG_CACHE* cache); - -ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName);
/* filter messages that are affected by dwm */ static inline BOOL IsDWmMsg(UINT msg) @@ -68,3 +68,5 @@ if(notexpected) \ ok((status & (notexpected))!=(notexpected), "wrong queue status. got non expected %li\n", (DWORD)(notexpected)); \ } + +#endif
Added: trunk/rostests/apitests/include/user32testhelpers.h URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/include/user32tes... ============================================================================== --- trunk/rostests/apitests/include/user32testhelpers.h (added) +++ trunk/rostests/apitests/include/user32testhelpers.h [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -0,0 +1,13 @@ + +static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName) +{ + WNDCLASSEXW wcex; + + memset(&wcex, 0, sizeof(wcex)); + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.lpfnWndProc = lpfnWndProc; + wcex.hCursor = LoadCursor(NULL, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszClassName = lpszClassName; + return RegisterClassExW(&wcex); +}
Propchange: trunk/rostests/apitests/include/user32testhelpers.h ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/rostests/apitests/user32/AttachThreadInput.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/AttachThre... ============================================================================== --- trunk/rostests/apitests/user32/AttachThreadInput.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/AttachThreadInput.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -9,7 +9,8 @@
#include <wingdi.h> #include <winuser.h> -#include "helper.h" +#include <msgtrace.h> +#include <user32testhelpers.h>
#define DESKTOP_ALL_ACCESS 0x01ff
Modified: trunk/rostests/apitests/user32/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/CMakeLists... ============================================================================== --- trunk/rostests/apitests/user32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/CMakeLists.txt [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -1,7 +1,7 @@
list(APPEND SOURCE AttachThreadInput.c - helper.c + ../include/msgtrace.c CreateDialog.c CreateIconFromResourceEx.c CreateWindowEx.c
Modified: trunk/rostests/apitests/user32/DeferWindowPos.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/DeferWindo... ============================================================================== --- trunk/rostests/apitests/user32/DeferWindowPos.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/DeferWindowPos.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -8,8 +8,9 @@ #include <apitest.h>
#include <winuser.h> -#include "helper.h" #include <undocuser.h> +#include <msgtrace.h> +#include <user32testhelpers.h>
HWND hWnd1, hWnd2, hWnd3, hWnd4;
Modified: trunk/rostests/apitests/user32/GetDCEx.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/GetDCEx.c?... ============================================================================== --- trunk/rostests/apitests/user32/GetDCEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/GetDCEx.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -8,7 +8,6 @@ #include <stdio.h> #include <wine/test.h> #include <windows.h> -#include "helper.h"
#define DCX_USESTYLE 0x00010000
Modified: trunk/rostests/apitests/user32/RegisterClassEx.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/RegisterCl... ============================================================================== --- trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/RegisterClassEx.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -12,7 +12,6 @@ #include <wchar.h> #include <wingdi.h> #include <winuser.h> -#include "helper.h" #include <undocuser.h>
static ATOM _RegisterClass(LPCWSTR lpwszClassName, HINSTANCE hInstance, UINT style, WNDPROC lpfnWndProc)
Modified: trunk/rostests/apitests/user32/SendMessageTimeout.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SendMessag... ============================================================================== --- trunk/rostests/apitests/user32/SendMessageTimeout.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SendMessageTimeout.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -7,7 +7,9 @@
#include <apitest.h> #include <winuser.h> -#include "helper.h" + +#include <msgtrace.h> +#include <user32testhelpers.h>
static DWORD dwThread1; static DWORD dwThread2;
Modified: trunk/rostests/apitests/user32/SetActiveWindow.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetActiveW... ============================================================================== --- trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetActiveWindow.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -9,8 +9,10 @@
#include <wingdi.h> #include <winuser.h> -#include "helper.h" #include <undocuser.h> + +#include <msgtrace.h> +#include <user32testhelpers.h>
HWND hWnd1, hWnd2;
Modified: trunk/rostests/apitests/user32/SetParent.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetParent.... ============================================================================== --- trunk/rostests/apitests/user32/SetParent.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetParent.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -8,7 +8,8 @@ #include <apitest.h>
#include <winuser.h> -#include "helper.h" +#include <msgtrace.h> +#include <user32testhelpers.h>
static HWND hWndList[5 + 1]; static const int hWndCount = sizeof(hWndList) / sizeof(hWndList[0]) - 1;
Modified: trunk/rostests/apitests/user32/SetProp.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetProp.c?... ============================================================================== --- trunk/rostests/apitests/user32/SetProp.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SetProp.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -6,9 +6,8 @@ */
#include <apitest.h> - #include <winuser.h> -#include "helper.h" +#include <user32testhelpers.h>
static ATOM Atom1, Atom2, Atom3;
Modified: trunk/rostests/apitests/user32/SystemParametersInfo.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SystemPara... ============================================================================== --- trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -9,8 +9,10 @@
#include <wingdi.h> #include <winuser.h> -#include "helper.h" #include <undocuser.h> + +#include <msgtrace.h> +#include <user32testhelpers.h>
HWND hWnd1, hWnd2;
Modified: trunk/rostests/apitests/user32/TrackMouseEvent.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/TrackMouse... ============================================================================== --- trunk/rostests/apitests/user32/TrackMouseEvent.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/TrackMouseEvent.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -6,11 +6,12 @@ */
#include <apitest.h> - #include <wingdi.h> #include <winuser.h> -#include "helper.h" #include <undocuser.h> + +#include <msgtrace.h> +#include <user32testhelpers.h>
HWND hWnd1, hWnd2, hWnd3; HHOOK hMouseHookLL, hMouseHook;
Modified: trunk/rostests/apitests/user32/desktop.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/desktop.c?... ============================================================================== --- trunk/rostests/apitests/user32/desktop.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/desktop.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -12,7 +12,7 @@ #include <stdio.h> #include <wingdi.h> #include <winuser.h> -#include "helper.h" +#include <user32testhelpers.h> #include <ndk/umtypes.h> #include <ndk/obfuncs.h>
Removed: trunk/rostests/apitests/user32/helper.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/helper.c?r... ============================================================================== --- trunk/rostests/apitests/user32/helper.c [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/helper.c (removed) @@ -1,218 +0,0 @@ -/* - * PROJECT: ReactOS api tests - * LICENSE: GPL - See COPYING in the top level directory - * PURPOSE: helper functions - * PROGRAMMERS: Giannis Adamopoulos - */ - -#include <apitest.h> - -#include <stdio.h> -#include <winuser.h> -#include "helper.h" -#include <undocuser.h> - -MSG_CACHE default_cache = { -#ifdef _MSC_VER - 0 -#endif -}; -MSG_ENTRY empty_chain[]= {{0,0}}; - -static char* get_msg_name(UINT msg) -{ - switch(msg) - { - case WM_CREATE: return "WM_CREATE"; - case WM_NCCREATE: return "WM_NCCREATE"; - case WM_PARENTNOTIFY: return "WM_PARENTNOTIFY"; - case WM_DESTROY: return "WM_DESTROY"; - case WM_NCDESTROY: return "WM_NCDESTROY"; - case WM_CHILDACTIVATE: return "WM_CHILDACTIVATE"; - case WM_NCACTIVATE: return "WM_NCACTIVATE"; - case WM_ACTIVATE: return "WM_ACTIVATE"; - case WM_ACTIVATEAPP: return "WM_ACTIVATEAPP"; - case WM_WINDOWPOSCHANGING: return "WM_WINDOWPOSCHANGING"; - case WM_WINDOWPOSCHANGED: return "WM_WINDOWPOSCHANGED"; - case WM_SETFOCUS: return "WM_SETFOCUS"; - case WM_KILLFOCUS: return "WM_KILLFOCUS"; - case WM_NCPAINT: return "WM_NCPAINT"; - case WM_PAINT: return "WM_PAINT"; - case WM_ERASEBKGND: return "WM_ERASEBKGND"; - case WM_SIZE: return "WM_SIZE"; - case WM_MOVE: return "WM_MOVE"; - case WM_SHOWWINDOW: return "WM_SHOWWINDOW"; - case WM_QUERYNEWPALETTE: return "WM_QUERYNEWPALETTE"; - case WM_MOUSELEAVE: return "WM_MOUSELEAVE"; - case WM_MOUSEHOVER: return "WM_MOUSEHOVER"; - case WM_NCMOUSELEAVE: return "WM_NCMOUSELEAVE"; - case WM_NCMOUSEHOVER: return "WM_NCMOUSEHOVER"; - case WM_NCHITTEST: return "WM_NCHITTEST"; - case WM_SETCURSOR: return "WM_SETCURSOR"; - case WM_MOUSEMOVE: return "WM_MOUSEMOVE"; - case WM_SYSTIMER: return "WM_SYSTIMER"; - case WM_GETMINMAXINFO: return "WM_GETMINMAXINFO"; - case WM_NCCALCSIZE: return "WM_NCCALCSIZE"; - case WM_SETTINGCHANGE: return "WM_SETTINGCHANGE"; - case WM_GETICON: return "WM_GETICON"; - case WM_SETICON: return "WM_SETICON"; - case WM_KEYDOWN: return "WM_KEYDOWN"; - case WM_KEYUP: return "WM_KEYUP"; - default: return NULL; - } -} - -static char* get_hook_name(UINT id) -{ - switch (id) - { - case WH_KEYBOARD: return "WH_KEYBOARD"; - case WH_KEYBOARD_LL: return "WH_KEYBOARD_LL"; - case WH_MOUSE: return "WH_MOUSE"; - case WH_MOUSE_LL: return "WH_MOUSE_LL"; - default: return NULL; - } -} - -void empty_message_cache(MSG_CACHE* cache) -{ - memset(cache, 0, sizeof(MSG_CACHE)); -} - -void sprintf_msg_entry(char* buffer, MSG_ENTRY* msg) -{ - if(!msg->iwnd && !msg->msg) - { - sprintf(buffer, "nothing"); - } - else - { - char* msgName; - char* msgType; - - switch (msg->type) - { - case POST: - msgName = get_msg_name(msg->msg); - msgType = "post msg"; - break; - case SENT: - msgName = get_msg_name(msg->msg); - msgType = "sent msg"; - break; - case HOOK: - msgName = get_hook_name(msg->msg); - msgType = "hook"; - break; - case EVENT: - msgName = NULL; - msgType = "event"; - break; - default: - return; - } - - if(msgName) - sprintf(buffer, "hwnd%d %s %s %d %d", msg->iwnd, msgType, msgName, msg->param1, msg->param2); - else - sprintf(buffer, "hwnd%d %s %d %d %d", msg->iwnd, msgType, msg->msg, msg->param1, msg->param2); - } -} - -void trace_cache(MSG_CACHE* cache, const char* file, int line) -{ - int i; - char buff[100]; - - for (i=0; i < cache->count; i++) - { - sprintf_msg_entry(buff, &cache->message_cache[i]); - trace_(file,line)("%d: %s\n", i, buff); - } - trace_(file,line)("\n"); -} - -void compare_cache(MSG_CACHE* cache, const char* file, int line, MSG_ENTRY *msg_chain) -{ - int i = 0; - char buffGot[100], buffExp[100]; - BOOL got_error = FALSE; - - while(1) - { - BOOL same = !memcmp(&cache->message_cache[i],msg_chain, sizeof(MSG_ENTRY)); - - sprintf_msg_entry(buffGot, &cache->message_cache[i]); - sprintf_msg_entry(buffExp, msg_chain); - ok_(file,line)(same,"%d: got %s, expected %s\n",i, buffGot, buffExp); - - if(!got_error && !same) - got_error = TRUE; - - if(msg_chain->msg !=0 || msg_chain->iwnd != 0) - msg_chain++; - else - { - if(i > cache->count) - break; - } - i++; - } - - if(got_error ) - { - trace_(file,line)("The complete list of messages got is:\n"); - trace_cache(cache, file,line); - } - - empty_message_cache(cache); -} - -void record_message(MSG_CACHE* cache, int iwnd, UINT message, MSG_TYPE type, int param1,int param2) -{ - if(cache->count >= 100) - { - return; - } - - /* do not report a post message a second time */ - if(type == SENT && - cache->last_post_message.iwnd == iwnd && - cache->last_post_message.msg == message && - cache->last_post_message.param1 == param1 && - cache->last_post_message.param2 == param2) - { - memset(&cache->last_post_message, 0, sizeof(MSG_ENTRY)); - return; - } - - cache->message_cache[cache->count].iwnd = iwnd; - cache->message_cache[cache->count].msg = message; - cache->message_cache[cache->count].type = type; - cache->message_cache[cache->count].param1 = param1; - cache->message_cache[cache->count].param2 = param2; - - if(cache->message_cache[cache->count].type == POST) - { - cache->last_post_message = cache->message_cache[cache->count]; - } - else - { - memset(&cache->last_post_message, 0, sizeof(MSG_ENTRY)); - } - - cache->count++; -} - -ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName) -{ - WNDCLASSEXW wcex; - - memset(&wcex, 0, sizeof(wcex)); - wcex.cbSize = sizeof(WNDCLASSEX); - wcex.lpfnWndProc = lpfnWndProc; - wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); - wcex.lpszClassName = lpszClassName; - return RegisterClassExW(&wcex); -}
Removed: trunk/rostests/apitests/user32/helper.h URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/helper.h?r... ============================================================================== --- trunk/rostests/apitests/user32/helper.h [iso-8859-1] (original) +++ trunk/rostests/apitests/user32/helper.h (removed) @@ -1,70 +0,0 @@ - -typedef enum _MSG_TYPE -{ - SENT, - POST, - HOOK, - EVENT -} MSG_TYPE; - -typedef struct _MSG_ENTRY -{ - int iwnd; - UINT msg; - MSG_TYPE type; - int param1; - int param2; -} MSG_ENTRY; - -typedef struct _MSG_CACHE -{ - MSG_ENTRY last_post_message; - MSG_ENTRY message_cache[100]; - int count; -} MSG_CACHE; - -extern MSG_ENTRY empty_chain[]; -extern MSG_CACHE default_cache; - -void record_message(MSG_CACHE* cache, int iwnd, UINT message, MSG_TYPE type, int param1,int param2); -void compare_cache(MSG_CACHE* cache, const char* file, int line, MSG_ENTRY *msg_chain); -void trace_cache(MSG_CACHE* cache, const char* file, int line); -void empty_message_cache(MSG_CACHE* cache); - -ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName); - -/* filter messages that are affected by dwm */ -static inline BOOL IsDWmMsg(UINT msg) -{ - switch(msg) - { - case WM_NCPAINT: - case WM_ERASEBKGND: - case WM_PAINT: - case 0x031f: /*WM_DWMNCRENDERINGCHANGED*/ - return TRUE; - } - return FALSE; -} - -static inline BOOL IseKeyMsg(UINT msg) -{ - return (msg == WM_KEYUP || msg == WM_KEYDOWN); -} - -#define COMPARE_CACHE(msg_chain) compare_cache(&default_cache, __FILE__, __LINE__, msg_chain) -#define TRACE_CACHE() trace_cache(&default_cache, __FILE__, __LINE__) -#define EMPTY_CACHE() empty_message_cache(&default_cache); -#define RECORD_MESSAGE(...) record_message(&default_cache, ##__VA_ARGS__); - -#define COMPARE_CACHE_(cache, msg_chain) compare_cache(cache, __FILE__, __LINE__, msg_chain) -#define TRACE_CACHE_(cache) trace_cache(cache, __FILE__, __LINE__) -#define EMPTY_CACHE_(cache) empty_message_cache(cache); - -#define EXPECT_QUEUE_STATUS(expected, notexpected) \ - { \ - DWORD status = HIWORD(GetQueueStatus(QS_ALLEVENTS)); \ - ok(((status) & (expected))== (expected),"wrong queue status. expected %li, and got %li\n", (DWORD)(expected), status); \ - if(notexpected) \ - ok((status & (notexpected))!=(notexpected), "wrong queue status. got non expected %li\n", (DWORD)(notexpected)); \ - }
Added: trunk/rostests/apitests/uxtheme/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/CMakeList... ============================================================================== --- trunk/rostests/apitests/uxtheme/CMakeLists.txt (added) +++ trunk/rostests/apitests/uxtheme/CMakeLists.txt [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -0,0 +1,11 @@ + +list(APPEND SOURCE + DrawThemeParentBackground.c + ../include/msgtrace.c + testlist.c) + +add_executable(uxtheme_apitest ${SOURCE}) +target_link_libraries(uxtheme_apitest wine ${PSEH_LIB}) +set_module_type(uxtheme_apitest win32cui) +add_importlibs(uxtheme_apitest uxtheme comctl32 user32 msvcrt kernel32) +add_rostests_file(TARGET uxtheme_apitest)
Propchange: trunk/rostests/apitests/uxtheme/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rostests/apitests/uxtheme/DrawThemeParentBackground.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/DrawTheme... ============================================================================== --- trunk/rostests/apitests/uxtheme/DrawThemeParentBackground.c (added) +++ trunk/rostests/apitests/uxtheme/DrawThemeParentBackground.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -0,0 +1,105 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for DrawThemeParentBackground + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include <apitest.h> +#include <stdio.h> +#include <windows.h> +#include <uxtheme.h> +#include <undocuser.h> +#include <msgtrace.h> +#include <user32testhelpers.h> + +HWND hWnd1, hWnd2; + +static int get_iwnd(HWND hWnd) +{ + if(hWnd == hWnd1) return 1; + else if(hWnd == hWnd2) return 2; + else return 0; +} + +static LRESULT CALLBACK TestProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + int iwnd = get_iwnd(hwnd); + + if(message > WM_USER || !iwnd || message == WM_GETICON) + return DefWindowProc(hwnd, message, wParam, lParam); + + RECORD_MESSAGE(iwnd, message, SENT, 0,0); + return DefWindowProc(hwnd, message, wParam, lParam); +} + +static void FlushMessages() +{ + MSG msg; + + while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) + { + int iwnd = get_iwnd(msg.hwnd); + if(iwnd && msg.message <= WM_USER) + RECORD_MESSAGE(iwnd, msg.message, POST,0,0); + DispatchMessageW( &msg ); + } +} + +MSG_ENTRY draw_parent_chain[]={{1, WM_ERASEBKGND}, + {1, WM_PRINTCLIENT}, + {0,0}}; + +void Test_Messages() +{ + HDC hdc; + RECT rc; + + RegisterSimpleClass(TestProc, L"testClass"); + + hWnd1 = CreateWindowW(L"testClass", L"Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100, 100, 200, 200, 0, NULL, NULL, NULL); + ok (hWnd1 != NULL, "Expected CreateWindowW to succeed\n"); + ShowWindow(hWnd1, SW_SHOW); + UpdateWindow(hWnd1); + + hWnd2 = CreateWindowW(L"testClass", L"test window", WS_CHILD | WS_VISIBLE, 0, 0, 100, 100, hWnd1, NULL, NULL, NULL); + ok (hWnd2 != NULL, "Expected CreateWindowW to succeed\n"); + ShowWindow(hWnd2, SW_SHOW); + UpdateWindow(hWnd2); + + FlushMessages(); + EMPTY_CACHE(); + + DrawThemeParentBackground(hWnd2, NULL, NULL); + FlushMessages(); + COMPARE_CACHE(empty_chain); + + DrawThemeParentBackground(hWnd1, NULL, NULL); + FlushMessages(); + COMPARE_CACHE(empty_chain); + + hdc = GetDC(hWnd1); + + DrawThemeParentBackground(hWnd2, hdc, NULL); + FlushMessages(); + COMPARE_CACHE(draw_parent_chain); + + DrawThemeParentBackground(hWnd1, hdc, NULL); + FlushMessages(); + COMPARE_CACHE(empty_chain); + + memset(&rc, 0, sizeof(rc)); + + DrawThemeParentBackground(hWnd2, hdc, &rc); + FlushMessages(); + COMPARE_CACHE(draw_parent_chain); + + DrawThemeParentBackground(hWnd1, hdc, &rc); + FlushMessages(); + COMPARE_CACHE(empty_chain); +} + +START_TEST(DrawThemeParentBackground) +{ + Test_Messages(); +}
Propchange: trunk/rostests/apitests/uxtheme/DrawThemeParentBackground.c ------------------------------------------------------------------------------ svn:eol-style = native
Added: trunk/rostests/apitests/uxtheme/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/testlist.... ============================================================================== --- trunk/rostests/apitests/uxtheme/testlist.c (added) +++ trunk/rostests/apitests/uxtheme/testlist.c [iso-8859-1] Tue Mar 7 22:29:48 2017 @@ -0,0 +1,12 @@ +#define __ROS_LONG64__ + +#define STANDALONE +#include <apitest.h> + +extern void func_DrawThemeParentBackground(void); + +const struct test winetest_testlist[] = +{ + { "DrawThemeParentBackground", func_DrawThemeParentBackground }, + { 0, 0 } +};
Propchange: trunk/rostests/apitests/uxtheme/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native