https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c35e75897d2b97b51ee78…
commit c35e75897d2b97b51ee7842a9d7ff72edb1d0656
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Wed Feb 1 19:23:36 2023 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Thu Feb 2 15:13:54 2023 +0100
[UXTHEME_APITEST] Skip some tests that fail without a theme
---
.../apitests/uxtheme/DrawThemeParentBackground.c | 10 ++++++++--
modules/rostests/apitests/uxtheme/SetWindowTheme.c | 19 +++++++++++++++----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
b/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
index e7603b52fbd..8e4480c3b42 100644
--- a/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
+++ b/modules/rostests/apitests/uxtheme/DrawThemeParentBackground.c
@@ -186,7 +186,10 @@ void Test_Params()
ok (hr == E_HANDLE, "Expected E_HANDLE got 0x%lx error\n", hr);
hr = DrawThemeParentBackground(hWnd2, hdc, NULL);
- ok (hr == S_FALSE, "Expected S_FALSE got 0x%lx error\n", hr);
+ if (IsThemeActive())
+ ok (hr == S_FALSE, "Expected S_FALSE got 0x%lx error\n", hr);
+ else
+ skip("Theme not active\n");
ReleaseDC(hWnd1, hdc);
hdc = GetDC(hWnd2);
@@ -196,7 +199,10 @@ void Test_Params()
ok (hr == S_OK, "Expected success got 0x%lx error\n", hr);
hr = DrawThemeParentBackground(hWnd2, hdc, NULL);
- ok (hr == S_FALSE, "Expected S_FALSE got 0x%lx error\n", hr);
+ if (IsThemeActive())
+ ok (hr == S_FALSE, "Expected S_FALSE got 0x%lx error\n", hr);
+ else
+ skip("Theme not active\n");
ReleaseDC(hWnd2, hdc);
diff --git a/modules/rostests/apitests/uxtheme/SetWindowTheme.c
b/modules/rostests/apitests/uxtheme/SetWindowTheme.c
index 6adf17c0f0b..874f4c3c85a 100644
--- a/modules/rostests/apitests/uxtheme/SetWindowTheme.c
+++ b/modules/rostests/apitests/uxtheme/SetWindowTheme.c
@@ -45,7 +45,10 @@ void TestTheme(HWND hwnd)
ok (hr == S_OK, "Expected S_OK got 0x%lx error\n", hr);
htheme1 = OpenThemeData(hwnd, L"Toolbar");
- ok (htheme1 != NULL, "OpenThemeData failed\n");
+ if (IsThemeActive())
+ ok (htheme1 != NULL, "OpenThemeData failed\n");
+ else
+ skip("Theme not active\n");
hr = SetWindowTheme(hwnd, L"", L"");
ok (hr == S_OK, "Expected S_OK got 0x%lx error\n", hr);
@@ -63,9 +66,15 @@ void TestTheme(HWND hwnd)
ok (hr == S_OK, "Expected S_OK got 0x%lx error\n", hr);
htheme2 = OpenThemeData(hwnd, L"Toolbar");
- ok (htheme2 != NULL, "OpenThemeData failed\n");
-
- ok(htheme1 != htheme2, "Expected different theme data\n");
+ if (IsThemeActive())
+ {
+ ok (htheme2 != NULL, "OpenThemeData failed\n");
+ ok(htheme1 != htheme2, "Expected different theme data\n");
+ }
+ else
+ {
+ skip("Theme not active\n");
+ }
}
START_TEST(SetWindowTheme)
@@ -77,4 +86,6 @@ START_TEST(SetWindowTheme)
TestParams(hwnd);
TestTheme(hwnd);
+
+ DestroyWindow(hwnd);
}
\ No newline at end of file