[PATCH 2/3] comctl32/tests: Add separate test for CreateUpDownControl()

Nikolay Sivov nsivov at codeweavers.com
Thu Dec 21 03:14:44 CST 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/comctl32/tests/updown.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/dlls/comctl32/tests/updown.c b/dlls/comctl32/tests/updown.c
index d6dbde01aa..1c21873d26 100644
--- a/dlls/comctl32/tests/updown.c
+++ b/dlls/comctl32/tests/updown.c
@@ -800,6 +800,29 @@ static void test_UDS_SETBUDDYINT(void)
     DestroyWindow(updown);
 }
 
+static void test_CreateUpDownControl(void)
+{
+    HWND updown, buddy;
+    DWORD range, pos;
+    RECT rect;
+
+    GetClientRect(parent_wnd, &rect);
+    updown = CreateUpDownControl(WS_CHILD | WS_BORDER | WS_VISIBLE,
+        0, 0, rect.right, rect.bottom, parent_wnd, 1, GetModuleHandleA(NULL), g_edit, 100, 10, 50);
+    ok(updown != NULL, "Failed to create control.\n");
+
+    buddy = (HWND)SendMessageA(updown, UDM_GETBUDDY, 0, 0);
+    ok(buddy == g_edit, "Unexpected buddy window.\n");
+
+    range = SendMessageA(updown, UDM_GETRANGE, 0, 0);
+    ok(range == MAKELONG(100, 10), "Unexpected range.\n");
+
+    pos = SendMessageA(updown, UDM_GETPOS, 0, 0);
+    ok(pos == MAKELONG(50, 1), "Unexpected position.\n");
+
+    DestroyWindow(updown);
+}
+
 START_TEST(updown)
 {
     HMODULE mod = GetModuleHandleA("comctl32.dll");
@@ -821,6 +844,7 @@ START_TEST(updown)
     test_updown_base();
     test_updown_unicode();
     test_UDS_SETBUDDYINT();
+    test_CreateUpDownControl();
 
     DestroyWindow(g_edit);
     DestroyWindow(parent_wnd);
-- 
2.15.1




More information about the wine-devel mailing list