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
d04d1f52
Commit
d04d1f52
authored
Jun 25, 2013
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Jul 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Implement DataConvert Variant->R8.
parent
0ad8a18e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
convert.c
dlls/oledb32/convert.c
+5
-0
convert.c
dlls/oledb32/tests/convert.c
+54
-0
No files found.
dlls/oledb32/convert.c
View file @
d04d1f52
...
...
@@ -361,6 +361,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
case
DBTYPE_BSTR
:
hr
=
VarR8FromStr
(
*
(
WCHAR
**
)
src
,
LOCALE_USER_DEFAULT
,
0
,
d
);
break
;
case
DBTYPE_BOOL
:
hr
=
VarR8FromBool
(
*
(
VARIANT_BOOL
*
)
src
,
d
);
break
;
case
DBTYPE_DECIMAL
:
hr
=
VarR8FromDec
((
DECIMAL
*
)
src
,
d
);
break
;
case
DBTYPE_VARIANT
:
VariantInit
(
&
tmp
);
if
((
hr
=
VariantChangeType
(
&
tmp
,
(
VARIANT
*
)
src
,
0
,
VT_R8
))
==
S_OK
)
*
d
=
V_R8
(
&
tmp
);
break
;
default:
FIXME
(
"Unimplemented conversion %04x -> R8
\n
"
,
src_type
);
return
E_NOTIMPL
;
}
break
;
...
...
dlls/oledb32/tests/convert.c
View file @
d04d1f52
...
...
@@ -2276,6 +2276,59 @@ static void test_converttor4(void)
ok
(
dst
==
10
.
0
,
"got %f
\n
"
,
dst
);
}
static
void
test_converttor8
(
void
)
{
HRESULT
hr
;
DOUBLE
dst
;
BYTE
src
[
20
];
DBSTATUS
dst_status
;
DBLENGTH
dst_len
;
VARIANT
var
;
dst
=
1
.
0
;
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_EMPTY
,
DBTYPE_R8
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
0
.
0
,
"got %f
\n
"
,
dst
);
dst
=
1
.
0
;
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_NULL
,
DBTYPE_R8
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
DB_E_UNSUPPORTEDCONVERSION
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_E_BADACCESSOR
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
0x1234
,
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
1
.
0
,
"got %f
\n
"
,
dst
);
dst
=
1
.
0
;
*
(
signed
int
*
)
src
=
12345678
;
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I4
,
DBTYPE_R8
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
12345678
.
0
,
"got %f
\n
"
,
dst
);
dst
=
1
.
0
;
*
(
FLOAT
*
)
src
=
10
.
0
;
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_R4
,
DBTYPE_R8
,
0
,
&
dst_len
,
src
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
10
.
0
,
"got %f
\n
"
,
dst
);
dst_len
=
dst
=
0x1234
;
V_VT
(
&
var
)
=
VT_I2
;
V_I2
(
&
var
)
=
0x4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_VARIANT
,
DBTYPE_R8
,
0
,
&
dst_len
,
&
var
,
&
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_OK
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
sizeof
(
dst
),
"got %ld
\n
"
,
dst_len
);
ok
(
dst
==
0x4321
,
"got %f
\n
"
,
dst
);
}
static
void
test_converttocy
(
void
)
{
HRESULT
hr
;
...
...
@@ -2862,6 +2915,7 @@ START_TEST(convert)
test_converttoui1
();
test_converttoui4
();
test_converttor4
();
test_converttor8
();
test_converttofiletime
();
test_converttocy
();
test_converttoui8
();
...
...
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