Author: gadamopoulos Date: Wed Aug 9 07:14:44 2017 New Revision: 75513 URL: http://svn.reactos.org/svn/reactos?rev=75513&view=rev Log: [UXTHEME_APITEST] -Add tests for SetThemeAppProperties.
Added: trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c (with props) Modified: trunk/rostests/apitests/uxtheme/CMakeLists.txt trunk/rostests/apitests/uxtheme/testlist.c Modified: trunk/rostests/apitests/uxtheme/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/CMakeLists.txt?rev=75513&r1=75512&r2=75513&view=diff ============================================================================== --- trunk/rostests/apitests/uxtheme/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/uxtheme/CMakeLists.txt [iso-8859-1] Wed Aug 9 07:14:44 2017 @@ -3,6 +3,7 @@ CloseThemeData.c DrawThemeParentBackground.c SetWindowTheme.c + SetThemeAppProperties.c ../include/msgtrace.c testlist.c) Added: trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c?rev=75513 ============================================================================== --- trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c (added) +++ trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c [iso-8859-1] Wed Aug 9 07:14:44 2017 @@ -0,0 +1,84 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for SetThemeAppProperties + * PROGRAMMERS: Giannis Adamopoulos + */ + +#include <apitest.h> +#include <stdio.h> +#include <windows.h> +#include <uxtheme.h> +#include <vfwmsgs.h> + +START_TEST(SetThemeAppProperties) +{ + BOOL bThemeActive; + HTHEME hTheme; + HWND hWnd; + + bThemeActive = IsThemeActive(); + if (!bThemeActive) + { + skip("No active theme, skipping SetWindowTheme tests\n"); + return; + } + + SetLastError(0xdeadbeef); + + bThemeActive = IsAppThemed(); + ok (bThemeActive == FALSE, "\n"); + ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = OpenThemeData(NULL, L"BUTTON"); + ok (hTheme == NULL, "\n"); + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError()); + + hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL); + ok (hWnd != NULL, "\n"); + + SetLastError(0xdeadbeef); + bThemeActive = IsAppThemed(); + ok (bThemeActive == TRUE, "\n"); + ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError()); + + SetLastError(0xdeadbeef); + hTheme = OpenThemeData(NULL, L"BUTTON"); + ok (hTheme != NULL, "\n"); + ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError()); + + SetLastError(0xdeadbeef); + SetThemeAppProperties(0); + ok( GetLastError() == 0, "Expected 0 last error, got 0x%lx\n", GetLastError()); + + bThemeActive = IsThemeActive(); + ok (bThemeActive == TRUE, "\n"); + + bThemeActive = IsAppThemed(); + ok (bThemeActive == TRUE, "\n"); + + SetLastError(0xdeadbeef); + hTheme = OpenThemeData(NULL, L"BUTTON"); + ok (hTheme == NULL, "\n"); + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError()); + + SetThemeAppProperties(STAP_ALLOW_NONCLIENT); + + hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT); + ok (hTheme != NULL, "\n"); + SetLastError(0xdeadbeef); + hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0); + ok (hTheme == NULL, "\n"); + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError()); + + SetThemeAppProperties(STAP_ALLOW_CONTROLS); + + SetLastError(0xdeadbeef); + hTheme = OpenThemeDataEx (NULL, L"BUTTON", OTD_NONCLIENT); + ok (hTheme == NULL, "\n"); + ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED last error, got 0x%lx\n", GetLastError()); + hTheme = OpenThemeDataEx (NULL, L"BUTTON", 0); + ok (hTheme != NULL, "\n"); + +} Propchange: trunk/rostests/apitests/uxtheme/SetThemeAppProperties.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/rostests/apitests/uxtheme/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/uxtheme/testlist.c?rev=75513&r1=75512&r2=75513&view=diff ============================================================================== --- trunk/rostests/apitests/uxtheme/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/uxtheme/testlist.c [iso-8859-1] Wed Aug 9 07:14:44 2017 @@ -5,6 +5,7 @@ extern void func_CloseThemeData(void); extern void func_DrawThemeParentBackground(void); +extern void func_SetThemeAppProperties(void); extern void func_SetWindowTheme(void); const struct test winetest_testlist[] = @@ -12,5 +13,6 @@ { "CloseThemeData", func_CloseThemeData }, { "DrawThemeParentBackground", func_DrawThemeParentBackground }, { "SetWindowTheme", func_SetWindowTheme }, + { "SetThemeAppProperties", func_SetThemeAppProperties }, { 0, 0 } };