Nikolay Sivov : user32/tests: Add some more SetScrollInfo() tests.

Alexandre Julliard julliard at winehq.org
Wed Jan 8 16:28:01 CST 2020


Module: wine
Branch: master
Commit: 04643b789cb1810f0cd464677f7b7c55a8a763a1
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=04643b789cb1810f0cd464677f7b7c55a8a763a1

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jan  8 16:30:10 2020 +0300

user32/tests: Add some more SetScrollInfo() tests.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/tests/scroll.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c
index fbc94a6d68..9c892ed484 100644
--- a/dlls/user32/tests/scroll.c
+++ b/dlls/user32/tests/scroll.c
@@ -561,6 +561,8 @@ static void test_SetScrollInfo(void)
 
     ret = IsWindowEnabled(hScroll);
     ok(!ret, "scroll bar enabled\n");
+    ret = IsWindowVisible(hScroll);
+    ok(!ret, "Unexpected visible state.\n");
 
     memset(&si, 0, sizeof(si));
     si.cbSize = sizeof(si);
@@ -581,6 +583,8 @@ static void test_SetScrollInfo(void)
     SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
     ret = IsWindowEnabled(hScroll);
     ok(!ret, "scroll bar enabled\n");
+    ret = IsWindowVisible(hScroll);
+    ok(!ret, "Unexpected visible state.\n");
 
     si.fMask = 0xf;
     ret = GetScrollInfo(hScroll, SB_CTL, &si);
@@ -588,6 +592,8 @@ static void test_SetScrollInfo(void)
 
     EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH);
     ok(IsWindowEnabled(hScroll), "expected enabled scrollbar\n");
+    ret = IsWindowVisible(hScroll);
+    ok(!ret, "Unexpected visible state.\n");
 
     si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
     si.nMax = 10;
@@ -597,6 +603,76 @@ static void test_SetScrollInfo(void)
     SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
     ret = IsWindowEnabled(hScroll);
     ok(ret, "scroll bar disabled\n");
+    ret = IsWindowVisible(hScroll);
+    ok(!ret, "Unexpected visible state.\n");
+
+    /* With visible window. */
+    ShowWindow(mainwnd, SW_SHOW);
+
+    ret = IsWindowVisible(hScroll);
+    ok(ret, "Unexpected visible state.\n");
+
+    EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH);
+    ret = IsWindowEnabled(hScroll);
+    ok(!ret, "Unexpected enabled state.\n");
+
+    /* Enabled state is changed only for visible windows, and only with redraw flag. */
+    si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
+    si.nMax = 100;
+    si.nMin = 10;
+    si.nPos = 0;
+    si.nPage = 50;
+    SetScrollInfo(hScroll, SB_CTL, &si, FALSE);
+    ret = IsWindowEnabled(hScroll);
+    ok(!ret, "Unexpected enabled state.\n");
+
+    /* State changes when called with same arguments too. */
+    si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
+    si.nMax = 100;
+    si.nMin = 10;
+    si.nPos = 0;
+    si.nPage = 50;
+    SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
+    ret = IsWindowEnabled(hScroll);
+todo_wine
+    ok(ret, "Unexpected enabled state.\n");
+
+    si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
+    si.nMax = 100;
+    si.nMin = 10;
+    si.nPos = 0;
+    si.nPage = 100;
+    SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
+    ret = IsWindowEnabled(hScroll);
+    ok(!ret, "Unexpected enabled state.\n");
+
+    EnableScrollBar(hScroll, SB_CTL, ESB_ENABLE_BOTH);
+    ret = IsWindowEnabled(hScroll);
+    ok(ret, "Unexpected enabled state.\n");
+
+    si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
+    si.nMax = 100;
+    si.nMin = 10;
+    si.nPos = 0;
+    si.nPage = 100;
+    SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
+    ret = IsWindowEnabled(hScroll);
+todo_wine
+    ok(!ret, "Unexpected enabled state.\n");
+
+    EnableScrollBar(hScroll, SB_CTL, ESB_DISABLE_BOTH);
+    ret = IsWindowEnabled(hScroll);
+    ok(!ret, "Unexpected enabled state.\n");
+
+    si.fMask = SIF_POS|SIF_RANGE|SIF_PAGE|SIF_DISABLENOSCROLL;
+    si.nMax = 41;
+    si.nMin = 0;
+    si.nPos = 0;
+    si.nPage = 41;
+    SetScrollInfo(hScroll, SB_CTL, &si, TRUE);
+    ret = IsWindowEnabled(hScroll);
+todo_wine
+    ok(ret, "Unexpected enabled state.\n");
 
     DestroyWindow(hScroll);
     DestroyWindow(mainwnd);




More information about the wine-cvs mailing list