[uxtheme/tests][5] Only test the needed functions once, bail out if one is missing

Paul Vriens Paul.Vriens at xs4all.nl
Wed Jun 21 13:37:10 CDT 2006


Hi,

only test the needed functions once. New tests are covering several
functions and it would clutter the code to check the existence every
time.

All functions that I'm going to write tests for will be checked against
XP/W2K3 and Wine. If a function doesn't exist it will be explicitly
checked in the needed test. uxtheme contains some new functions for
Vista so if Vista-apps turn up those will be single checked.

Changelog
  Only test the needed functions once, bail out if one is missing.

Cheers,

Paul.

---
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
index dc60105..1072498 100644
--- a/dlls/uxtheme/tests/system.c
+++ b/dlls/uxtheme/tests/system.c
@@ -58,6 +58,15 @@ static BOOL InitFunctionPtrs(void)
       UXTHEME_GET_PROC(OpenThemeData)
       UXTHEME_GET_PROC(SetWindowTheme)
     }
+    /* The following functions should be available, if not return FALSE. The Vista functions will
+     * be checked (at some point in time) within the single tests if needed. All used functions for
+     * now are present on WinXP, W2K3 and Wine.
+     */
+    if (!pCloseThemeData || !pGetWindowTheme ||
+        !pIsAppThemed || !pIsThemeActive ||
+        !pOpenThemeData || !pSetWindowTheme)
+        return FALSE;
+
     return TRUE;
 }
 
@@ -268,28 +277,23 @@ START_TEST(system)
 
     /* IsThemeActive and IsAppThemed */
     trace("Starting test_IsThemed()\n");
-    if (pIsAppThemed && pIsThemeActive)
-        test_IsThemed();
+    test_IsThemed();
 
     /* GetWindowTheme */
     trace("Starting test_GetWindowTheme()\n");
-    if (pGetWindowTheme)
-        test_GetWindowTheme();
+    test_GetWindowTheme();
 
     /* SetWindowTheme */
     trace("Starting test_SetWindowTheme()\n");
-    if (pSetWindowTheme)
-        test_SetWindowTheme();
+    test_SetWindowTheme();
 
     /* OpenThemeData */
     trace("Starting test_OpenThemeData()\n");
-    if (pOpenThemeData && pIsThemeActive) 
-        test_OpenThemeData();
+    test_OpenThemeData();
 
     /* CloseThemeData */
     trace("Starting test_CloseThemeData()\n");
-    if (pCloseThemeData)
-        test_CloseThemeData();
+    test_CloseThemeData();
 
     FreeLibrary(hUxtheme);
 }
-- 
1.4.0




More information about the wine-patches mailing list