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
b161c151
Commit
b161c151
authored
Jan 28, 2009
by
Jeremy White
Committed by
Alexandre Julliard
Jan 29, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
twain_32: Add an interactive set of tests for a selected scanner.
parent
f7c267da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
0 deletions
+99
-0
dsm.c
dlls/twain_32/tests/dsm.c
+99
-0
No files found.
dlls/twain_32/tests/dsm.c
View file @
b161c151
...
...
@@ -57,6 +57,92 @@ static void get_condition_code(TW_IDENTITY *appid, TW_IDENTITY *source, TW_STATU
ok
(
rc
==
TWRC_SUCCESS
,
"Condition code not available, rc %d
\n
"
,
rc
);
}
static
void
test_single_source
(
TW_IDENTITY
*
appid
,
TW_IDENTITY
*
source
)
{
TW_UINT16
rc
;
TW_STATUS
status
;
TW_CAPABILITY
cap
;
UINT16
capabilities
[
CAP_CUSTOMBASE
];
memset
(
&
cap
,
0
,
sizeof
(
cap
));
cap
.
Cap
=
CAP_SUPPORTEDCAPS
;
cap
.
ConType
=
TWON_DONTCARE16
;
rc
=
pDSM_Entry
(
appid
,
source
,
DG_CONTROL
,
DAT_CAPABILITY
,
MSG_GET
,
&
cap
);
get_condition_code
(
appid
,
source
,
&
status
);
todo_wine
ok
(
rc
==
TWRC_SUCCESS
||
status
.
ConditionCode
==
TWCC_SUCCESS
,
"Error obtaining CAP_SUPPORTEDCAPS
\n
"
);
memset
(
capabilities
,
0
,
sizeof
(
capabilities
));
if
(
rc
==
TWRC_SUCCESS
&&
cap
.
ConType
==
TWON_ARRAY
)
{
TW_ARRAY
*
a
;
a
=
GlobalLock
(
cap
.
hContainer
);
if
(
a
)
{
if
(
a
->
ItemType
==
TWTY_UINT16
)
{
int
i
;
UINT16
*
u
=
(
UINT16
*
)
a
->
ItemList
;
trace
(
"%d Capabilities:
\n
"
,
a
->
NumItems
);
for
(
i
=
0
;
i
<
a
->
NumItems
;
i
++
)
if
(
u
[
i
]
<
sizeof
(
capabilities
)
/
sizeof
(
capabilities
[
0
]))
{
capabilities
[
u
[
i
]]
=
1
;
trace
(
" %d: 0x%x
\n
"
,
i
,
u
[
i
]);
}
}
GlobalUnlock
(
cap
.
hContainer
);
}
}
/* For Twain 1.6, all sources must support: */
todo_wine
ok
(
capabilities
[
CAP_SUPPORTEDCAPS
],
"CAP_SUPPORTEDCAPS not supported
\n
"
);
todo_wine
ok
(
capabilities
[
CAP_XFERCOUNT
],
"CAP_XFERCOUNT not supported
\n
"
);
todo_wine
ok
(
capabilities
[
CAP_UICONTROLLABLE
],
"CAP_UICONTROLLABLE not supported
\n
"
);
if
(
source
->
SupportedGroups
&
DG_IMAGE
)
{
/* For Twain 1.6:
Sources that supply image information must support DG_CONTROL / DAT_CAPABILITY /
MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT on:
*/
todo_wine
ok
(
capabilities
[
ICAP_COMPRESSION
],
"ICAP_COMPRESSION not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_PLANARCHUNKY
],
"ICAP_PLANARCHUNKY not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_PHYSICALHEIGHT
],
"ICAP_PHYSICALHEIGHT not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_PHYSICALWIDTH
],
"ICAP_PHYSICALWIDTH not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_PIXELFLAVOR
],
"ICAP_PIXELFLAVOR not supported
\n
"
);
/* For Twain 1.6:
Sources that supply image information must support DG_CONTROL / DAT_CAPABILITY /
MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT, MSG_RESET and MSG_SET on:
*/
todo_wine
ok
(
capabilities
[
ICAP_BITDEPTH
],
"ICAP_BITDEPTH not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_BITORDER
],
"ICAP_BITORDER not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_PIXELTYPE
],
"ICAP_PIXELTYPE not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_UNITS
],
"ICAP_UNITS not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_XFERMECH
],
"ICAP_XFERMECH not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_XRESOLUTION
],
"ICAP_XRESOLUTION not supported
\n
"
);
todo_wine
ok
(
capabilities
[
ICAP_YRESOLUTION
],
"ICAP_YRESOLUTION not supported
\n
"
);
}
}
static
void
test_sources
(
TW_IDENTITY
*
appid
)
{
TW_UINT16
rc
;
...
...
@@ -115,6 +201,19 @@ static void test_sources(TW_IDENTITY *appid)
rc
=
pDSM_Entry
(
appid
,
NULL
,
DG_CONTROL
,
DAT_IDENTITY
,
MSG_USERSELECT
,
&
source
);
get_condition_code
(
appid
,
NULL
,
&
status
);
ok
(
rc
==
TWRC_SUCCESS
||
rc
==
TWRC_CANCEL
,
"Userselect failed, rc %d, cc %d
\n
"
,
rc
,
status
.
ConditionCode
);
if
(
rc
==
TWRC_SUCCESS
&&
status
.
ConditionCode
==
TWCC_SUCCESS
)
{
rc
=
pDSM_Entry
(
appid
,
NULL
,
DG_CONTROL
,
DAT_IDENTITY
,
MSG_OPENDS
,
&
source
);
get_condition_code
(
appid
,
NULL
,
&
status
);
if
(
rc
==
TWRC_SUCCESS
&&
status
.
ConditionCode
==
TWCC_SUCCESS
)
{
test_single_source
(
appid
,
&
source
);
rc
=
pDSM_Entry
(
appid
,
NULL
,
DG_CONTROL
,
DAT_IDENTITY
,
MSG_CLOSEDS
,
&
source
);
get_condition_code
(
appid
,
NULL
,
&
status
);
ok
(
rc
==
TWRC_SUCCESS
,
"Close DS Failed, rc %d, cc %d
\n
"
,
rc
,
status
.
ConditionCode
);
}
}
}
}
...
...
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