mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 09:25:44 +00:00
[UXTHEME_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
svn path=/trunk/; revision=67404
This commit is contained in:
parent
f2599b4baa
commit
a3a21c0bcf
1 changed files with 7 additions and 78 deletions
|
@ -81,24 +81,11 @@ static void test_IsThemed(void)
|
||||||
BOOL bAppThemed;
|
BOOL bAppThemed;
|
||||||
BOOL bTPDefined;
|
BOOL bTPDefined;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
bThemeActive = pIsThemeActive();
|
bThemeActive = pIsThemeActive();
|
||||||
trace("Theming is %s\n", (bThemeActive) ? "active" : "inactive");
|
trace("Theming is %s\n", (bThemeActive) ? "active" : "inactive");
|
||||||
|
|
||||||
/* This test is not themed */
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
bAppThemed = pIsAppThemed();
|
bAppThemed = pIsAppThemed();
|
||||||
|
trace("Test executable is %s\n", (bAppThemed) ? "themed" : "not themed");
|
||||||
if (bThemeActive)
|
|
||||||
todo_wine
|
|
||||||
ok( bAppThemed == FALSE, "Expected FALSE as this test executable is not (yet) themed.\n");
|
|
||||||
else
|
|
||||||
/* Although Wine currently returns FALSE, the logic behind it is wrong. It is not a todo_wine though in the testing sense */
|
|
||||||
ok( bAppThemed == FALSE, "Expected FALSE as this test executable is not (yet) themed.\n");
|
|
||||||
|
|
||||||
ok( GetLastError() == ERROR_SUCCESS,
|
|
||||||
"Expected ERROR_SUCCESS, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
bTPDefined = pIsThemePartDefined(NULL, 0 , 0);
|
bTPDefined = pIsThemePartDefined(NULL, 0 , 0);
|
||||||
|
@ -145,26 +132,16 @@ static void test_SetWindowTheme(void)
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
BOOL bDestroyed;
|
BOOL bDestroyed;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pSetWindowTheme(NULL, NULL, NULL);
|
hRes = pSetWindowTheme(NULL, NULL, NULL);
|
||||||
todo_wine
|
todo_wine
|
||||||
{
|
|
||||||
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Only do the bare minimum to get a valid hwnd */
|
/* Only do the bare minimum to get a valid hwnd */
|
||||||
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL);
|
||||||
if (!hWnd) return;
|
if (!hWnd) return;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pSetWindowTheme(hWnd, NULL, NULL);
|
hRes = pSetWindowTheme(hWnd, NULL, NULL);
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
bDestroyed = DestroyWindow(hWnd);
|
bDestroyed = DestroyWindow(hWnd);
|
||||||
if (!bDestroyed)
|
if (!bDestroyed)
|
||||||
|
@ -292,20 +269,12 @@ static void test_OpenThemeData(void)
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
"Expected 0xdeadbeef, got 0x%08x\n",
|
||||||
GetLastError());
|
GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pCloseThemeData(hTheme);
|
hRes = pCloseThemeData(hTheme);
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* Close a second time */
|
/* Close a second time */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pCloseThemeData(hTheme);
|
hRes = pCloseThemeData(hTheme);
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* See if closing makes a difference for GetWindowTheme */
|
/* See if closing makes a difference for GetWindowTheme */
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
|
@ -489,69 +458,48 @@ static void test_GetCurrentThemeName(void)
|
||||||
bThemeActive = pIsThemeActive();
|
bThemeActive = pIsThemeActive();
|
||||||
|
|
||||||
/* All NULLs */
|
/* All NULLs */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(NULL, 0, NULL, 0, NULL, 0);
|
hRes = pGetCurrentThemeName(NULL, 0, NULL, 0, NULL, 0);
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* Number of characters given is 0 */
|
/* Number of characters given is 0 */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, 0, NULL, 0, NULL, 0);
|
hRes = pGetCurrentThemeName(currentTheme, 0, NULL, 0, NULL, 0);
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
ok( hRes == S_OK || broken(hRes == E_FAIL /* WinXP SP1 */), "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK || broken(hRes == E_FAIL /* WinXP SP1 */), "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, 2, NULL, 0, NULL, 0);
|
hRes = pGetCurrentThemeName(currentTheme, 2, NULL, 0, NULL, 0);
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) ||
|
ok(hRes == E_NOT_SUFFICIENT_BUFFER ||
|
||||||
broken(hRes == E_FAIL /* WinXP SP1 */),
|
broken(hRes == E_FAIL /* WinXP SP1 */),
|
||||||
"Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes);
|
"Expected E_NOT_SUFFICIENT_BUFFER, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* The same is true if the number of characters is too small for Color and/or Size */
|
/* 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),
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
||||||
currentColor, 2,
|
currentColor, 2,
|
||||||
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
todo_wine
|
todo_wine
|
||||||
ok(hRes == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) ||
|
ok(hRes == E_NOT_SUFFICIENT_BUFFER ||
|
||||||
broken(hRes == E_FAIL /* WinXP SP1 */),
|
broken(hRes == E_FAIL /* WinXP SP1 */),
|
||||||
"Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes);
|
"Expected E_NOT_SUFFICIENT_BUFFER, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* Given number of characters is correct */
|
/* Given number of characters is correct */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), NULL, 0, NULL, 0);
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), NULL, 0, NULL, 0);
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* Given number of characters for the theme name is too large */
|
/* Given number of characters for the theme name is too large */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme), NULL, 0, NULL, 0);
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme), NULL, 0, NULL, 0);
|
||||||
if (bThemeActive)
|
if (bThemeActive)
|
||||||
ok( hRes == E_POINTER || hRes == S_OK, "Expected E_POINTER or S_OK, got 0x%08x\n", hRes);
|
ok( hRes == E_POINTER || hRes == S_OK, "Expected E_POINTER or S_OK, got 0x%08x\n", hRes);
|
||||||
|
@ -559,12 +507,8 @@ static void test_GetCurrentThemeName(void)
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED ||
|
ok( hRes == E_PROP_ID_UNSUPPORTED ||
|
||||||
hRes == E_POINTER, /* win2k3 */
|
hRes == E_POINTER, /* win2k3 */
|
||||||
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
"Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* The too large case is only for the theme name, not for color name or size name */
|
/* 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),
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
||||||
currentColor, sizeof(currentTheme),
|
currentColor, sizeof(currentTheme),
|
||||||
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
||||||
|
@ -572,11 +516,7 @@ static void test_GetCurrentThemeName(void)
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
||||||
currentColor, sizeof(currentTheme) / sizeof(WCHAR),
|
currentColor, sizeof(currentTheme) / sizeof(WCHAR),
|
||||||
currentSize, sizeof(currentSize));
|
currentSize, sizeof(currentSize));
|
||||||
|
@ -584,12 +524,8 @@ static void test_GetCurrentThemeName(void)
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
|
|
||||||
/* Correct call */
|
/* Correct call */
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR),
|
||||||
currentColor, sizeof(currentColor) / sizeof(WCHAR),
|
currentColor, sizeof(currentColor) / sizeof(WCHAR),
|
||||||
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
currentSize, sizeof(currentSize) / sizeof(WCHAR));
|
||||||
|
@ -597,21 +533,14 @@ static void test_GetCurrentThemeName(void)
|
||||||
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes);
|
||||||
else
|
else
|
||||||
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_CloseThemeData(void)
|
static void test_CloseThemeData(void)
|
||||||
{
|
{
|
||||||
HRESULT hRes;
|
HRESULT hRes;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
|
||||||
hRes = pCloseThemeData(NULL);
|
hRes = pCloseThemeData(NULL);
|
||||||
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
||||||
ok( GetLastError() == 0xdeadbeef,
|
|
||||||
"Expected 0xdeadbeef, got 0x%08x\n",
|
|
||||||
GetLastError());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(system)
|
START_TEST(system)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue