Module: wine
Branch: master
Commit: b6241e4ad81ace16f8a1dff8da7d9312ba033c2e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b6241e4ad81ace16f8a1dff8d…
Author: Anatoly Lyutin <vostok(a)etersoft.ru>
Date: Fri Feb 22 17:03:26 2008 +0300
user32: Added some tests for scrollbar.
---
dlls/user32/tests/Makefile.in | 1 +
dlls/user32/tests/scroll.c | 163 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 164 insertions(+), 0 deletions(-)
diff --git a/dlls/user32/tests/Makefile.in b/dlls/user32/tests/Makefile.in
index 9fd26ec..c3794cc 100644
--- a/dlls/user32/tests/Makefile.in
+++ b/dlls/user32/tests/Makefile.in
@@ -21,6 +21,7 @@ CTESTS = \
monitor.c \
msg.c \
resource.c \
+ scroll.c \
static.c \
sysparams.c \
text.c \
diff --git a/dlls/user32/tests/scroll.c b/dlls/user32/tests/scroll.c
new file mode 100644
index 0000000..5832b51
--- /dev/null
+++ b/dlls/user32/tests/scroll.c
@@ -0,0 +1,163 @@
+/*
+ * Unit tests for scrollbar
+ *
+ * Copyright 2008 Lyutin Anatoly (Etersoft)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <windows.h>
+
+#include "wine/test.h"
+
+static HWND hScroll, hMainWnd;
+
+static LRESULT CALLBACK MyWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
+{
+ switch(msg)
+ {
+
+ case WM_CREATE:
+ {
+ hScroll = CreateWindowA( "SCROLLBAR", "", WS_CHILD | WS_VISIBLE, 0, 0, 120, 100, hWnd, (HMENU)100, GetModuleHandleA(0), 0 );
+
+ return 0;
+ }
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+
+ default:
+ return DefWindowProcA(hWnd, msg, wParam, lParam);
+ }
+ return 0;
+}
+
+static void scrollbar_test1(void)
+{
+ BOOL ret;
+
+ ret = EnableScrollBar( hScroll, SB_CTL, ESB_DISABLE_BOTH );
+ ok( ret, "The scrollbar should be disabled.\n" );
+ todo_wine
+ {
+ ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
+ }
+
+ ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH );
+ ok( ret, "The scrollbar should be enabled.\n" );
+ ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
+
+}
+
+static void scrollbar_test2(void)
+{
+ int ret;
+
+ trace("The scrollbar is disabled.\n");
+
+ EnableWindow( hScroll, FALSE );
+ ok( !IsWindowEnabled( hScroll ), "The scroll should be disabled.\n" );
+
+ ret = SetScrollPos( hScroll, SB_CTL, 30, TRUE);
+ ok( !ret, "The position should not be set.\n" );
+
+ ret = GetScrollPos( hScroll, SB_CTL);
+ ok( !ret, "The position should be equal to zero\n");
+
+ ret = SetScrollRange( hScroll, SB_CTL, 0, 100, TRUE );
+ ok( ret, "The range should be set.\n" );
+
+ ret = SetScrollPos( hScroll, SB_CTL, 30, TRUE);
+ ok( !ret , "The position should not be set.\n" );
+
+ ret = GetScrollPos( hScroll, SB_CTL);
+ ok( ret == 30, "The position should be set!!!\n");
+
+ trace("The scrollbar is enabled.\n");
+
+ EnableWindow( hScroll, TRUE );
+ ok( IsWindowEnabled( hScroll ), "The scroll should be enabled.\n" );
+
+ ret = SetScrollPos( hScroll, SB_CTL, 30, TRUE);
+ ok( ret == 30, "The position should be set.\n" );
+
+ ret = GetScrollPos( hScroll, SB_CTL);
+ ok( ret == 30, "The position should not be equal to zero\n");
+
+ ret = SetScrollRange( hScroll, SB_CTL, 0, 100, TRUE );
+ ok( ret, "The range should be set.\n" );
+
+ ret = SetScrollPos( hScroll, SB_CTL, 30, TRUE);
+ ok( ret == 30, "The position should be set.\n" );
+
+ ret = GetScrollPos( hScroll, SB_CTL);
+ ok( ret == 30, "The position should not be equal to zero\n");
+}
+
+static void scrollbar_test3(void)
+{
+ BOOL ret;
+
+ ret = ShowScrollBar( hScroll, SB_CTL, FALSE );
+ ok( ret, "The ShowScrollBar() should not failed.\n" );
+ ok( !IsWindowVisible( hScroll ), "The scrollbar window should not be visible\n" );
+
+ ret = ShowScrollBar( hScroll, SB_CTL, TRUE );
+ ok( ret, "The ShowScrollBar() should not failed.\n" );
+ ok( !IsWindowVisible( hScroll ), "The scrollbar window should be visible\n" );
+
+ ret = ShowScrollBar( NULL, SB_CTL, TRUE );
+ todo_wine
+ {
+ ok( !ret, "The ShowScrollBar() should failed.\n" );
+ }
+
+}
+
+START_TEST ( scroll )
+{
+ WNDCLASSA wc;
+
+ wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = GetModuleHandleA(NULL);
+ wc.hIcon = NULL;
+ wc.hCursor = LoadCursorA(NULL, IDC_IBEAM);
+ wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = "MyTestWnd";
+ wc.lpfnWndProc = MyWndProc;
+ RegisterClassA(&wc);
+
+ hMainWnd = CreateWindowExA( 0, "MyTestWnd", "Scroll", WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, GetModuleHandleA(NULL), 0 );
+
+ if ( !ok( hMainWnd != NULL, "Failed to create parent window. Tests aborted.\n" ) )
+ return;
+
+ assert( hScroll );
+
+ scrollbar_test1();
+ scrollbar_test2();
+ scrollbar_test3();
+
+ DestroyWindow(hScroll);
+ DestroyWindow(hMainWnd);
+}
Module: wine
Branch: master
Commit: 708e217506b82f7d159aaa929315956a6f8dd9cb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=708e217506b82f7d159aaa929…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Feb 12 18:27:56 2008 +0100
d3d9: ATI drivers do not handle D3DUSAGE_QUERY_LEGACYBUMPMAP properly.
---
dlls/d3d9/tests/visual.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index f799af8..be45ac6 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -6468,10 +6468,14 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device)
skip("D3DTEXOPCAPS_BUMPENVMAP not set, skipping bumpmap tests\n");
return;
} else {
+ /* This check is disabled, some Windows drivers do not handle D3DUSAGE_QUERY_LEGACYBUMPMAP properly.
+ * They report that it is not supported, but after that bump mapping works properly. So just test
+ * if the format is generally supported, and check the BUMPENVMAP flag
+ */
IDirect3D9 *d3d9;
IDirect3DDevice9_GetDirect3D(device, &d3d9);
- hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_LEGACYBUMPMAP,
+ hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0,
D3DRTYPE_TEXTURE, D3DFMT_V8U8);
IDirect3D9_Release(d3d9);
if(FAILED(hr)) {