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
853de70b
Commit
853de70b
authored
Mar 01, 2017
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32/tests: Add tests for conversion to DBTYPE_STR.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
28debe67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
convert.c
dlls/oledb32/tests/convert.c
+44
-0
No files found.
dlls/oledb32/tests/convert.c
View file @
853de70b
...
...
@@ -1516,6 +1516,9 @@ static void test_converttostr(void)
DBSTATUS
dst_status
;
DBLENGTH
dst_len
;
static
const
WCHAR
ten
[]
=
{
'1'
,
'0'
,
0
};
static
const
WCHAR
idW
[]
=
{
'0'
,
'C'
,
'7'
,
'3'
,
'3'
,
'A'
,
'8'
,
'D'
,
'-'
,
'2'
,
'A'
,
'1'
,
'C'
,
0
};
static
const
char
idA
[]
=
"0C733A8D"
;
static
const
char
withnull
[]
=
"test
\0
ed"
;
static
const
char
ten_a
[]
=
"10"
;
static
const
char
fourthreetwoone
[]
=
"4321"
;
static
const
char
guid_str
[]
=
"{0C733A8D-2A1C-11CE-ADE5-00AA0044773D}"
;
...
...
@@ -1877,6 +1880,47 @@ static void test_converttostr(void)
ok
(
!
lstrcmpA
(
ten_a
,
dst
),
"got %s
\n
"
,
dst
);
SysFreeString
(
b
);
b
=
SysAllocString
(
idW
);
*
(
BSTR
*
)
src
=
b
;
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_BSTR
,
DBTYPE_STR
,
0
,
&
dst_len
,
src
,
dst
,
9
,
0
,
&
dst_status
,
0
,
0
,
0
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
dst_status
==
DBSTATUS_S_TRUNCATED
,
"got %08x
\n
"
,
dst_status
);
ok
(
dst_len
==
13
,
"got %ld
\n
"
,
dst_len
);
ok
(
!
lstrcmpA
(
idA
,
dst
),
"got %s
\n
"
,
dst
);
SysFreeString
(
b
);
memcpy
(
src
,
withnull
,
sizeof
(
withnull
));
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_STR
,
DBTYPE_STR
,
sizeof
(
withnull
),
&
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 %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
withnull
,
dst
,
8
),
"got %s
\n
"
,
dst
);
ok
(
dst
[
8
]
==
0
,
"got %02x
\n
"
,
dst
[
8
]);
memcpy
(
src
,
withnull
,
sizeof
(
withnull
));
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_STR
,
DBTYPE_STR
,
7
,
&
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
==
7
,
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
withnull
,
dst
,
7
),
"got %s
\n
"
,
dst
);
ok
(
dst
[
7
]
==
0
,
"got %02x
\n
"
,
dst
[
7
]);
memcpy
(
src
,
withnull
,
sizeof
(
withnull
));
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
hr
=
IDataConvert_DataConvert
(
convert
,
DBTYPE_STR
,
DBTYPE_STR
,
6
,
&
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
==
6
,
"got %ld
\n
"
,
dst_len
);
ok
(
!
memcmp
(
withnull
,
dst
,
6
),
"got %s
\n
"
,
dst
);
ok
(
dst
[
6
]
==
0
,
"got %02x
\n
"
,
dst
[
6
]);
memcpy
(
src
,
ten
,
sizeof
(
ten
));
memset
(
dst
,
0xcc
,
sizeof
(
dst
));
dst_len
=
0x1234
;
...
...
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