Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b4c5a623
Commit
b4c5a623
authored
Aug 02, 2009
by
John Klehm
Committed by
Alexandre Julliard
Aug 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintab32: Add a test for context validation by WTOpen.
parent
eb101df6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
175 additions
and
0 deletions
+175
-0
configure
configure
+9
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/wintab32/tests/Makefile.in
+13
-0
context.c
dlls/wintab32/tests/context.c
+152
-0
No files found.
configure
View file @
b4c5a623
...
...
@@ -28001,6 +28001,14 @@ dlls/wintab32/Makefile: dlls/wintab32/Makefile.in dlls/Makedll.rules"
ac_config_files
=
"
$ac_config_files
dlls/wintab32/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/wintab32/tests/Makefile"
test
"x
$enable_tests
"
!=
xno
&&
ALL_TEST_DIRS
=
"
$ALL_TEST_DIRS
\\
wintab32/tests"
ALL_MAKEFILE_DEPENDS
=
"
$ALL_MAKEFILE_DEPENDS
dlls/wintab32/tests/Makefile: dlls/wintab32/tests/Makefile.in dlls/Maketest.rules"
ac_config_files
=
"
$ac_config_files
dlls/wintab32/tests/Makefile"
ALL_MAKEFILES
=
"
$ALL_MAKEFILES
\\
dlls/wintrust/Makefile"
test
"x
$enable_wintrust
"
!=
xno
&&
ALL_DLL_DIRS
=
"
$ALL_DLL_DIRS
\\
wintrust"
...
...
@@ -29794,6 +29802,7 @@ do
"dlls/winspool.drv/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/winspool.drv/tests/Makefile" ;;
"dlls/wintab.dll16/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wintab.dll16/Makefile" ;;
"dlls/wintab32/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wintab32/Makefile" ;;
"dlls/wintab32/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wintab32/tests/Makefile" ;;
"dlls/wintrust/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wintrust/Makefile" ;;
"dlls/wintrust/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wintrust/tests/Makefile" ;;
"dlls/wldap32/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/wldap32/Makefile" ;;
...
...
configure.ac
View file @
b4c5a623
...
...
@@ -2431,6 +2431,7 @@ WINE_CONFIG_MAKEFILE([dlls/winspool.drv/Makefile],[dlls/Makedll.rules],[dlls],[A
WINE_CONFIG_MAKEFILE([dlls/winspool.drv/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/wintab.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16])
WINE_CONFIG_MAKEFILE([dlls/wintab32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/wintab32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/wintrust/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/wintrust/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests])
WINE_CONFIG_MAKEFILE([dlls/wldap32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
...
...
dlls/wintab32/tests/Makefile.in
0 → 100644
View file @
b4c5a623
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
wintab32.dll
IMPORTS
=
kernel32 user32
CTESTS
=
\
context.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/wintab32/tests/context.c
0 → 100644
View file @
b4c5a623
/*
* tests for Wintab context behavior
*
* Copyright 2009 John Klehm
*
* 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 <windows.h>
#include <wintab.h>
#include "wine/test.h"
static
const
CHAR
wintab32Dll
[]
=
"Wintab32.dll"
;
static
const
CHAR
defaultWindowName
[]
=
"Wintab Test"
;
static
const
CHAR
wintabTestWindowClassName
[]
=
"WintabTestWnd"
;
static
const
CHAR
contextName
[]
=
"TestContext"
;
static
const
UINT
X
=
0
;
static
const
UINT
Y
=
0
;
static
const
UINT
WIDTH
=
200
;
static
const
UINT
HEIGHT
=
200
;
static
HCTX
(
WINAPI
*
pWTOpenA
)(
HWND
,
LPLOGCONTEXTA
,
BOOL
);
static
BOOL
(
WINAPI
*
pWTClose
)(
HCTX
);
static
HMODULE
load_functions
(
void
)
{
#define GET_PROC(func) \
(p ## func = (void *)GetProcAddress(hWintab, #func))
HMODULE
hWintab
=
LoadLibraryA
(
wintab32Dll
);
if
(
!
hWintab
)
{
trace
(
"LoadLibraryA(%s) failed
\n
"
,
wintab32Dll
);
return
NULL
;
}
if
(
GET_PROC
(
WTOpenA
)
&&
GET_PROC
(
WTClose
)
)
{
return
hWintab
;
}
else
{
FreeLibrary
(
hWintab
);
trace
(
"Library loaded but failed to load function pointers
\n
"
);
return
NULL
;
}
#undef GET_PROC
}
static
LRESULT
CALLBACK
wintabTestWndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
DefWindowProcA
(
hwnd
,
msg
,
wParam
,
lParam
);
}
static
void
wintab_create_window
(
HWND
*
pHwnd
)
{
WNDCLASSA
testWindowClass
;
if
(
!
pHwnd
)
return
;
*
pHwnd
=
NULL
;
ZeroMemory
(
&
testWindowClass
,
sizeof
(
testWindowClass
));
testWindowClass
.
lpfnWndProc
=
(
WNDPROC
)
wintabTestWndProc
;
testWindowClass
.
hInstance
=
NULL
;
testWindowClass
.
hIcon
=
NULL
;
testWindowClass
.
hCursor
=
NULL
;
testWindowClass
.
hbrBackground
=
NULL
;
testWindowClass
.
lpszMenuName
=
NULL
;
testWindowClass
.
lpszClassName
=
wintabTestWindowClassName
;
assert
(
RegisterClassA
(
&
testWindowClass
));
*
pHwnd
=
CreateWindowA
(
wintabTestWindowClassName
,
NULL
,
WS_OVERLAPPED
,
X
,
Y
,
WIDTH
,
HEIGHT
,
NULL
,
NULL
,
NULL
,
NULL
);
assert
(
*
pHwnd
!=
NULL
);
}
static
void
wintab_destroy_window
(
HWND
hwnd
)
{
DestroyWindow
(
hwnd
);
UnregisterClassA
(
wintabTestWindowClassName
,
NULL
);
}
/* test how a logcontext is validated by wtopen */
static
void
test_WTOpenContextValidation
(
void
)
{
HWND
defaultWindow
=
NULL
;
HCTX
hCtx
=
NULL
;
LOGCONTEXTA
testLogCtx
;
LOGCONTEXTA
refLogCtx
;
int
memdiff
;
wintab_create_window
(
&
defaultWindow
);
ZeroMemory
(
&
testLogCtx
,
sizeof
(
testLogCtx
));
strcpy
(
testLogCtx
.
lcName
,
contextName
);
ZeroMemory
(
&
refLogCtx
,
sizeof
(
refLogCtx
));
strcpy
(
refLogCtx
.
lcName
,
contextName
);
/* a zeroed out context has values which makes WTOpen return null
* on wacom tablets but not on uclogic tablets */
hCtx
=
pWTOpenA
(
defaultWindow
,
&
testLogCtx
,
TRUE
);
/* check if the context gets updated */
memdiff
=
memcmp
(
&
testLogCtx
,
&
refLogCtx
,
sizeof
(
LOGCONTEXTA
));
ok
(
0
==
memdiff
,
"Expected 0 == memcmp(testLogCtx, refLogCtx), got %i
\n
"
,
memdiff
);
if
(
hCtx
)
pWTClose
(
hCtx
);
wintab_destroy_window
(
defaultWindow
);
}
START_TEST
(
context
)
{
HMODULE
hWintab
=
load_functions
();
if
(
!
hWintab
)
{
skip
(
"Wintab32.dll not available
\n
"
);
return
;
}
test_WTOpenContextValidation
();
FreeLibrary
(
hWintab
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment