Paul Vriens : uxtheme/tests: Add some tests for GetWindowTheme.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jun 22 06:16:51 CDT 2006
Module: wine
Branch: refs/heads/master
Commit: 36a775d0c7e810fb6fbafa41447c287a43f0e87e
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=36a775d0c7e810fb6fbafa41447c287a43f0e87e
Author: Paul Vriens <Paul.Vriens at xs4all.nl>
Date: Wed Jun 21 18:51:00 2006 +0200
uxtheme/tests: Add some tests for GetWindowTheme.
---
dlls/uxtheme/tests/system.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index 579c399..dc60105 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -26,6 +26,7 @@ #include "uxtheme.h"
#include "wine/test.h"
static HRESULT (WINAPI * pCloseThemeData)(HTHEME);
+static HTHEME (WINAPI * pGetWindowTheme)(HWND);
static BOOL (WINAPI * pIsAppThemed)(VOID);
static BOOL (WINAPI * pIsThemeActive)(VOID);
static HTHEME (WINAPI * pOpenThemeData)(HWND, LPCWSTR);
@@ -51,6 +52,7 @@ static BOOL InitFunctionPtrs(void)
if (hUxtheme)
{
UXTHEME_GET_PROC(CloseThemeData)
+ UXTHEME_GET_PROC(GetWindowTheme)
UXTHEME_GET_PROC(IsAppThemed)
UXTHEME_GET_PROC(IsThemeActive)
UXTHEME_GET_PROC(OpenThemeData)
@@ -89,6 +91,31 @@ static void test_IsThemed(void)
GetLastError());
}
+static void test_GetWindowTheme(void)
+{
+ HTHEME hTheme;
+ HWND hWnd;
+
+ SetLastError(0xdeadbeef);
+ hTheme = pGetWindowTheme(NULL);
+ ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
+ todo_wine
+ ok( GetLastError() == E_HANDLE,
+ "Expected E_HANDLE, got 0x%08lx\n",
+ GetLastError());
+
+ /* Only do the bare minumum to get a valid hwnd */
+ hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
+ if (!hWnd) return;
+
+ SetLastError(0xdeadbeef);
+ hTheme = pGetWindowTheme(hWnd);
+ ok( hTheme == NULL, "Expected a NULL return, got %p\n", hTheme);
+ ok( GetLastError() == 0xdeadbeef,
+ "Expected 0xdeadbeef, got 0x%08lx\n",
+ GetLastError());
+}
+
static void test_SetWindowTheme(void)
{
HRESULT hRes;
@@ -244,6 +271,11 @@ START_TEST(system)
if (pIsAppThemed && pIsThemeActive)
test_IsThemed();
+ /* GetWindowTheme */
+ trace("Starting test_GetWindowTheme()\n");
+ if (pGetWindowTheme)
+ test_GetWindowTheme();
+
/* SetWindowTheme */
trace("Starting test_SetWindowTheme()\n");
if (pSetWindowTheme)
More information about the wine-cvs
mailing list