[PATCH 1/3] comctl32/tests: Remove pager skip check.

Zhiyi Zhang zzhang at codeweavers.com
Fri Aug 24 09:04:20 CDT 2018


Pager should be available on all VMs(XP+) on TestBot.
So there's no need to check for the availability of
pager control. Add calling InitCommonControls() so that
pager control can be correctly initialized on XP.

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
 dlls/comctl32/tests/pager.c | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/dlls/comctl32/tests/pager.c b/dlls/comctl32/tests/pager.c
index 0da396cdd1..fa505dce68 100644
--- a/dlls/comctl32/tests/pager.c
+++ b/dlls/comctl32/tests/pager.c
@@ -32,6 +32,7 @@ static HWND parent_wnd, child1_wnd, child2_wnd;
 #define CHILD1_ID 1
 #define CHILD2_ID 2
 
+static BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*);
 static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR);
 
 static struct msg_sequence *sequences[NUM_MSG_SEQUENCES];
@@ -257,11 +258,7 @@ static void test_pager(void)
     RECT rect, rect2;
 
     pager = create_pager_control( PGS_HORZ );
-    if (!pager)
-    {
-        win_skip( "Pager control not supported\n" );
-        return;
-    }
+    ok(pager != NULL, "Fail to create pager\n");
 
     register_child_wnd_class();
 
@@ -333,11 +330,26 @@ static void test_pager(void)
     DestroyWindow( pager );
 }
 
-START_TEST(pager)
+static void init_functions(void)
 {
-    HMODULE mod = GetModuleHandleA("comctl32.dll");
+    HMODULE mod = LoadLibraryA("comctl32.dll");
+
+#define X(f) p##f = (void*)GetProcAddress(mod, #f);
+    X(InitCommonControlsEx);
+#undef X
 
     pSetWindowSubclass = (void*)GetProcAddress(mod, (LPSTR)410);
+}
+
+START_TEST(pager)
+{
+    INITCOMMONCONTROLSEX iccex;
+
+    init_functions();
+
+    iccex.dwSize = sizeof(iccex);
+    iccex.dwICC = ICC_PAGESCROLLER_CLASS;
+    pInitCommonControlsEx(&iccex);
 
     init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
 
@@ -345,4 +357,6 @@ START_TEST(pager)
     ok(parent_wnd != NULL, "Failed to create parent window!\n");
 
     test_pager();
+
+    DestroyWindow(parent_wnd);
 }
-- 
2.18.0





More information about the wine-devel mailing list