Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
d599dec1
Commit
d599dec1
authored
Jun 26, 2006
by
Paul Vriens
Committed by
Alexandre Julliard
Jun 27, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme/tests: Add tests for GetCurrentThemeName.
parent
5ca8bbd2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
1 deletion
+129
-1
system.c
dlls/uxtheme/tests/system.c
+129
-1
No files found.
dlls/uxtheme/tests/system.c
View file @
d599dec1
...
...
@@ -26,6 +26,7 @@
#include "wine/test.h"
static
HRESULT
(
WINAPI
*
pCloseThemeData
)(
HTHEME
);
static
HRESULT
(
WINAPI
*
pGetCurrentThemeName
)(
LPWSTR
,
int
,
LPWSTR
,
int
,
LPWSTR
,
int
);
static
HTHEME
(
WINAPI
*
pGetWindowTheme
)(
HWND
);
static
BOOL
(
WINAPI
*
pIsAppThemed
)(
VOID
);
static
BOOL
(
WINAPI
*
pIsThemeActive
)(
VOID
);
...
...
@@ -52,6 +53,7 @@ static BOOL InitFunctionPtrs(void)
if
(
hUxtheme
)
{
UXTHEME_GET_PROC
(
CloseThemeData
)
UXTHEME_GET_PROC
(
GetCurrentThemeName
)
UXTHEME_GET_PROC
(
GetWindowTheme
)
UXTHEME_GET_PROC
(
IsAppThemed
)
UXTHEME_GET_PROC
(
IsThemeActive
)
...
...
@@ -64,7 +66,8 @@ static BOOL InitFunctionPtrs(void)
*/
if
(
!
pCloseThemeData
||
!
pGetWindowTheme
||
!
pIsAppThemed
||
!
pIsThemeActive
||
!
pOpenThemeData
||
!
pSetWindowTheme
)
!
pOpenThemeData
||
!
pSetWindowTheme
||
!
pGetCurrentThemeName
)
return
FALSE
;
return
TRUE
;
...
...
@@ -316,6 +319,127 @@ static void test_OpenThemeData(void)
hWnd
,
GetLastError
());
}
static
void
test_GetCurrentThemeName
(
void
)
{
BOOL
bThemeActive
;
HRESULT
hRes
;
WCHAR
currentTheme
[
MAX_PATH
];
WCHAR
currentColor
[
MAX_PATH
];
WCHAR
currentSize
[
MAX_PATH
];
bThemeActive
=
pIsThemeActive
();
/* All NULLs */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
NULL
,
0
,
NULL
,
0
,
NULL
,
0
);
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* Number of characters given is 0 */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
0
,
NULL
,
0
,
NULL
,
0
);
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* When the number of characters given is too small (not 0, see above), GetCurrentThemeName returns 0x8007007a.
* The only definition I found was in strsafe.h:
*
* #define STRSAFE_E_INSUFFICIENT_BUFFER ((HRESULT)0x8007007AL) // 0x7A = 122L = ERROR_INSUFFICIENT_BUFFER
*/
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
2
,
NULL
,
0
,
NULL
,
0
);
if
(
bThemeActive
)
todo_wine
ok
(
LOWORD
(
hRes
)
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected 0x8007007A, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* The same is true if the number of characters is too small for Color and/or Size */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
currentColor
,
2
,
currentSize
,
sizeof
(
currentSize
)
/
sizeof
(
WCHAR
));
if
(
bThemeActive
)
todo_wine
ok
(
LOWORD
(
hRes
)
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected 0x8007007A, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* Given number of characters is correct */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
NULL
,
0
,
NULL
,
0
);
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* Given number of characters for the theme name is too large */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
),
NULL
,
0
,
NULL
,
0
);
todo_wine
ok
(
hRes
==
E_POINTER
,
"Expected E_POINTER, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* The too large case is only for the theme name, not for color name or size name */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
currentColor
,
sizeof
(
currentTheme
),
currentSize
,
sizeof
(
currentSize
)
/
sizeof
(
WCHAR
));
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
currentColor
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
currentSize
,
sizeof
(
currentSize
));
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
/* Correct call */
SetLastError
(
0xdeadbeef
);
hRes
=
pGetCurrentThemeName
(
currentTheme
,
sizeof
(
currentTheme
)
/
sizeof
(
WCHAR
),
currentColor
,
sizeof
(
currentColor
)
/
sizeof
(
WCHAR
),
currentSize
,
sizeof
(
currentSize
)
/
sizeof
(
WCHAR
));
if
(
bThemeActive
)
ok
(
hRes
==
S_OK
,
"Expected S_OK, got 0x%08lx
\n
"
,
hRes
);
else
ok
(
hRes
==
E_PROP_ID_UNSUPPORTED
,
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08lx
\n
"
,
hRes
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"Expected 0xdeadbeef, got 0x%08lx
\n
"
,
GetLastError
());
}
static
void
test_CloseThemeData
(
void
)
{
HRESULT
hRes
;
...
...
@@ -353,6 +477,10 @@ START_TEST(system)
trace
(
"Starting test_OpenThemeData()
\n
"
);
test_OpenThemeData
();
/* GetCurrentThemeName */
trace
(
"Starting test_GetCurrentThemeName()
\n
"
);
test_GetCurrentThemeName
();
/* CloseThemeData */
trace
(
"Starting test_CloseThemeData()
\n
"
);
test_CloseThemeData
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment