Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5028334c
Commit
5028334c
authored
Sep 17, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Sep 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32/tests: Add CanConvert tests.
parent
05926a10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
1 deletion
+77
-1
Makefile.in
dlls/oledb32/tests/Makefile.in
+1
-1
convert.c
dlls/oledb32/tests/convert.c
+76
-0
No files found.
dlls/oledb32/tests/Makefile.in
View file @
5028334c
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
oledb32.dll
IMPORTS
=
ole32 gdi32 advapi32 kernel32
IMPORTS
=
ole
aut32 ole
32 gdi32 advapi32 kernel32
CTESTS
=
\
convert.c
...
...
dlls/oledb32/tests/convert.c
View file @
5028334c
...
...
@@ -144,9 +144,85 @@ static void test_dcinfo(void)
IDCInfo_Release
(
info
);
}
struct
can_convert
{
DBTYPE
type
;
DWORD
can_convert_to
;
}
simple_convert
[]
=
{
{
DBTYPE_EMPTY
,
0x23bfd9ff
},
{
DBTYPE_NULL
,
0x00001002
},
{
DBTYPE_I2
,
0x3b9fd9ff
},
{
DBTYPE_I4
,
0x3bdfd9ff
},
{
DBTYPE_R4
,
0x3b9fd9ff
},
{
DBTYPE_R8
,
0x3b9fd9ff
},
{
DBTYPE_CY
,
0x039fd97f
},
{
DBTYPE_DATE
,
0x399f99bf
},
{
DBTYPE_BSTR
,
0x3bffd9ff
},
{
DBTYPE_IDISPATCH
,
0x3bffffff
},
{
DBTYPE_ERROR
,
0x01001500
},
{
DBTYPE_BOOL
,
0x039fd9ff
},
{
DBTYPE_VARIANT
,
0x3bffffff
},
{
DBTYPE_IUNKNOWN
,
0x00003203
},
{
DBTYPE_DECIMAL
,
0x3b9fd97f
},
{
DBTYPE_I1
,
0x3b9fd9ff
},
{
DBTYPE_UI1
,
0x3b9fd9ff
},
{
DBTYPE_UI2
,
0x3b9fd9ff
},
{
DBTYPE_UI4
,
0x3bdfd9ff
},
{
DBTYPE_I8
,
0x03dfd97f
},
{
DBTYPE_UI8
,
0x03dfd97f
},
{
DBTYPE_GUID
,
0x01e01103
},
{
DBTYPE_BYTES
,
0x01fc110b
},
{
DBTYPE_STR
,
0x3bffd9ff
},
{
DBTYPE_WSTR
,
0x3bffd9ff
},
{
DBTYPE_NUMERIC
,
0x039fd97f
},
{
DBTYPE_UDT
,
0x00000000
},
{
DBTYPE_DBDATE
,
0x39801183
},
{
DBTYPE_DBTIME
,
0x39801183
},
{
DBTYPE_DBTIMESTAMP
,
0x39801183
}
};
static
void
test_canconvert
(
void
)
{
IDataConvert
*
convert
;
HRESULT
hr
;
int
src_idx
,
dst_idx
;
hr
=
CoCreateInstance
(
&
CLSID_OLEDB_CONVERSIONLIBRARY
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IDataConvert
,
(
void
**
)
&
convert
);
if
(
FAILED
(
hr
))
{
win_skip
(
"Unable to load oledb conversion library
\n
"
);
return
;
}
for
(
src_idx
=
0
;
src_idx
<
sizeof
(
simple_convert
)
/
sizeof
(
simple_convert
[
0
]);
src_idx
++
)
for
(
dst_idx
=
0
;
dst_idx
<
sizeof
(
simple_convert
)
/
sizeof
(
simple_convert
[
0
]);
dst_idx
++
)
{
BOOL
expect
;
hr
=
IDataConvert_CanConvert
(
convert
,
simple_convert
[
src_idx
].
type
,
simple_convert
[
dst_idx
].
type
);
expect
=
(
simple_convert
[
src_idx
].
can_convert_to
>>
dst_idx
)
&
1
;
todo_wine
ok
((
hr
==
S_OK
&&
expect
==
TRUE
)
||
(
hr
==
S_FALSE
&&
expect
==
FALSE
),
"%04x -> %04x: got %08x expect conversion to be %spossible
\n
"
,
simple_convert
[
src_idx
].
type
,
simple_convert
[
dst_idx
].
type
,
hr
,
expect
?
""
:
"not "
);
}
IDataConvert_Release
(
convert
);
}
START_TEST
(
convert
)
{
OleInitialize
(
NULL
);
test_dcinfo
();
test_canconvert
();
OleUninitialize
();
}
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