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
23b556c5
Commit
23b556c5
authored
Nov 20, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Nov 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oledb32/tests: Add more IDataInitialize::GetInitializationString() tests.
parent
9c78628f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
database.c
dlls/oledb32/tests/database.c
+42
-0
No files found.
dlls/oledb32/tests/database.c
View file @
23b556c5
...
...
@@ -530,6 +530,25 @@ static void test_errorinfo(void)
IUnknown_Release
(
unk
);
}
#define expect_initstring(a, b, c) _expect_initstring(__LINE__, a, b, c)
static
void
_expect_initstring
(
int
line
,
IDataInitialize
*
datainit
,
const
WCHAR
*
initstring
,
const
WCHAR
*
expected
)
{
IDBInitialize
*
dbinit
=
NULL
;
WCHAR
*
result
=
NULL
;
HRESULT
hr
;
hr
=
IDataInitialize_GetDataSource
(
datainit
,
NULL
,
CLSCTX_INPROC_SERVER
,
initstring
,
&
IID_IDBInitialize
,
(
IUnknown
**
)
&
dbinit
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
hr
=
IDataInitialize_GetInitializationString
(
datainit
,
(
IUnknown
*
)
dbinit
,
0
,
&
result
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"got %08lx
\n
"
,
hr
);
todo_wine
ok_
(
__FILE__
,
line
)(
!
lstrcmpW
(
expected
,
result
),
"expected %s, got %s
\n
"
,
wine_dbgstr_w
(
expected
),
wine_dbgstr_w
(
result
));
CoTaskMemFree
(
result
);
IDBInitialize_Release
(
dbinit
);
}
static
void
test_initializationstring
(
void
)
{
static
const
WCHAR
*
initstring_default
=
L"Data Source=dummy;"
;
...
...
@@ -539,6 +558,20 @@ static void test_initializationstring(void)
static
const
WCHAR
*
initstring_mode
=
L"Provider=MSDASQL.1;Data Source=dummy;Mode=invalid"
;
static
const
WCHAR
*
initstring_mode2
=
L"Provider=MSDASQL.1;Data Source=dummy;Mode=WriteRead"
;
static
const
WCHAR
*
initstring_mode3
=
L"Provider=MSDASQL.1;Data Source=dummy;Mode=ReadWRITE"
;
static
const
WCHAR
*
initstring_quote_semicolon
=
L"Provider=MSDASQL.1;"
"Data Source=dummy;"
"Extended Properties=
\"
ConnectTo=11.0;Cell Error Mode=TextValue;Optimize Response=3;
\"
"
;
static
const
WCHAR
*
initstring_duplicate
=
L"Provider=MSDASQL.1;"
"Data Source=dummy;"
"Data Source=dummy;"
;
static
const
WCHAR
*
initstring_skip_properties
=
L"Provider=MSDASQL.1;"
"Data Source=dummy;"
"Window Handle=0;"
"Prompt=4;"
"Connect Timeout=1000;"
"General Timeout=1000;"
"OLE DB Services=0;"
"Locale Identifier=1033"
;
IDataInitialize
*
datainit
=
NULL
;
IDBInitialize
*
dbinit
;
HRESULT
hr
;
...
...
@@ -597,6 +630,15 @@ static void test_initializationstring(void)
else
ok
(
dbinit
==
NULL
,
"got %p
\n
"
,
dbinit
);
/* Test quoting property values */
expect_initstring
(
datainit
,
initstring_quote_semicolon
,
initstring_quote_semicolon
);
/* Test duplicate properties */
expect_initstring
(
datainit
,
initstring_duplicate
,
initstring_msdasql
);
/* Test properties that should be skipped */
expect_initstring
(
datainit
,
initstring_skip_properties
,
initstring_msdasql
);
IDataInitialize_Release
(
datainit
);
}
}
...
...
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