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
38a21bf1
Commit
38a21bf1
authored
Apr 05, 2010
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Apr 06, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32: Add tests for…
oledb32: Add tests for DBTYPE_I1/DBTYPE_UI1/DBTYPE_UI2/DBTYPE_UI4/DBTYPE_I8/DBTYPE_UI8 to DBTYPE_WSTR/DBTYPE_STR conversion.
parent
0d2b82fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
0 deletions
+100
-0
convert.c
dlls/oledb32/tests/convert.c
+100
-0
No files found.
dlls/oledb32/tests/convert.c
View file @
38a21bf1
...
...
@@ -1183,6 +1183,56 @@ static void test_converttowstr(void)
memset
(
src
,
0
,
sizeof
(
src
));
*
(
signed
char
*
)
src
=
10
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I1
,
DBTYPE_WSTR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
ten
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
char
*
)
src
=
10
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI1
,
DBTYPE_WSTR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
ten
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
short
*
)
src
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI2
,
DBTYPE_WSTR
,
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
==
8
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
int
*
)
src
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_WSTR
,
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
==
8
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
memset
(
src
,
0
,
sizeof
(
src
));
((
LARGE_INTEGER
*
)
src
)
->
QuadPart
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I8
,
DBTYPE_WSTR
,
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
==
8
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
memset
(
src
,
0
,
sizeof
(
src
));
((
ULARGE_INTEGER
*
)
src
)
->
QuadPart
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI8
,
DBTYPE_WSTR
,
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
==
8
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpW
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
wine_dbgstr_w
(
dst
));
b
=
SysAllocString
(
ten
);
*
(
BSTR
*
)
src
=
b
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BSTR
,
DBTYPE_WSTR
,
0
,
&
dst_len
,
src
,
dst
,
sizeof
(
dst
),
0
,
&
dst_status
,
0
,
0
,
0
);
...
...
@@ -1485,6 +1535,56 @@ static void test_converttostr(void)
memset
(
src
,
0
,
sizeof
(
src
));
*
(
signed
char
*
)
src
=
10
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I1
,
DBTYPE_STR
,
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
==
2
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
ten_a
),
"got %s
\n
"
,
dst
);
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
char
*
)
src
=
10
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI1
,
DBTYPE_STR
,
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
==
2
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
ten_a
),
"got %s
\n
"
,
dst
);
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
short
*
)
src
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI2
,
DBTYPE_STR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
dst
);
memset
(
src
,
0
,
sizeof
(
src
));
*
(
unsigned
int
*
)
src
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI4
,
DBTYPE_STR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
dst
);
memset
(
src
,
0
,
sizeof
(
src
));
((
LARGE_INTEGER
*
)
src
)
->
QuadPart
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_I8
,
DBTYPE_STR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
dst
);
memset
(
src
,
0
,
sizeof
(
src
));
((
ULARGE_INTEGER
*
)
src
)
->
QuadPart
=
4321
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_UI8
,
DBTYPE_STR
,
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
==
4
,
"got %d
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
dst
,
fourthreetwoone
),
"got %s
\n
"
,
dst
);
b
=
SysAllocString
(
ten
);
*
(
BSTR
*
)
src
=
b
;
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
...
...
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