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
94e5353f
Commit
94e5353f
authored
Feb 26, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scrrun/tests: More dictionary tests.
parent
afa965a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
2 deletions
+177
-2
scrrun.idl
dlls/scrrun/scrrun.idl
+4
-1
dictionary.c
dlls/scrrun/tests/dictionary.c
+169
-0
scrrun.idl
dlls/scrrun/tests/scrrun.idl
+4
-1
No files found.
dlls/scrrun/scrrun.idl
View file @
94e5353f
...
@@ -27,7 +27,10 @@ cpp_quote("#undef CopyFile")
...
@@ -27,7 +27,10 @@ cpp_quote("#undef CopyFile")
cpp_quote
(
"#undef DeleteFile"
)
cpp_quote
(
"#undef DeleteFile"
)
cpp_quote
(
"#undef MoveFile"
)
cpp_quote
(
"#undef MoveFile"
)
cpp_quote
(
"#endif"
)
cpp_quote
(
"#endif"
)
cpp_quote
(
"#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)"
)
/*
this
is
not
defined
in
public
headers
*/
/*
this
is
not
defined
in
public
headers
*/
cpp_quote
(
"#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)"
)
cpp_quote
(
"#define CTL_E_KEY_ALREADY_EXISTS STD_CTL_SCODE(457)"
)
cpp_quote
(
"#define CTL_E_ELEMENT_NOT_FOUND STD_CTL_SCODE(32811)"
)
[
[
uuid
(
420B2830
-
E718
-
11
CF
-893D-00
A0C9054228
),
uuid
(
420B2830
-
E718
-
11
CF
-893D-00
A0C9054228
),
...
...
dlls/scrrun/tests/dictionary.c
View file @
94e5353f
...
@@ -93,6 +93,7 @@ static void test_comparemode(void)
...
@@ -93,6 +93,7 @@ static void test_comparemode(void)
{
{
CompareMethod
method
;
CompareMethod
method
;
IDictionary
*
dict
;
IDictionary
*
dict
;
VARIANT
key
,
item
;
HRESULT
hr
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
...
@@ -122,6 +123,18 @@ if (0) /* crashes on native */
...
@@ -122,6 +123,18 @@ if (0) /* crashes on native */
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
method
==
DatabaseCompare
,
"got %d
\n
"
,
method
);
ok
(
method
==
DatabaseCompare
,
"got %d
\n
"
,
method
);
/* try to change mode of a non-empty dict */
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
VariantInit
(
&
item
);
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_put_CompareMode
(
dict
,
BinaryCompare
);
todo_wine
ok
(
hr
==
CTL_E_ILLEGALFUNCTIONCALL
,
"got 0x%08x
\n
"
,
hr
);
IDictionary_Release
(
dict
);
IDictionary_Release
(
dict
);
}
}
...
@@ -414,6 +427,159 @@ static void test_hash_value(void)
...
@@ -414,6 +427,159 @@ static void test_hash_value(void)
IDictionary_Release
(
dict
);
IDictionary_Release
(
dict
);
}
}
static
void
test_Exists
(
void
)
{
VARIANT_BOOL
exists
;
IDictionary
*
dict
;
VARIANT
key
,
item
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDictionary
,
(
void
**
)
&
dict
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
/* crashes on native */
hr
=
IDictionary_Exists
(
dict
,
NULL
,
NULL
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
NULL
);
todo_wine
ok
(
hr
==
CTL_E_ILLEGALFUNCTIONCALL
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
exists
=
VARIANT_TRUE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_FALSE
,
"got %x
\n
"
,
exists
);
}
VariantInit
(
&
item
);
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_R4
;
V_R4
(
&
key
)
=
0
.
0
;
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
todo_wine
ok
(
hr
==
CTL_E_KEY_ALREADY_EXISTS
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
NULL
);
todo_wine
ok
(
hr
==
CTL_E_ILLEGALFUNCTIONCALL
,
"got 0x%08x
\n
"
,
hr
);
V_VT
(
&
key
)
=
VT_I2
;
V_I2
(
&
key
)
=
0
;
exists
=
VARIANT_FALSE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_TRUE
,
"got %x
\n
"
,
exists
);
}
/* key of different type, but resolves to same hash value */
V_VT
(
&
key
)
=
VT_R4
;
V_R4
(
&
key
)
=
0
.
0
;
exists
=
VARIANT_FALSE
;
hr
=
IDictionary_Exists
(
dict
,
&
key
,
&
exists
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
VARIANT_TRUE
,
"got %x
\n
"
,
exists
);
}
IDictionary_Release
(
dict
);
}
static
void
test_Keys
(
void
)
{
VARIANT
key
,
keys
,
item
;
IDictionary
*
dict
;
LONG
index
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDictionary
,
(
void
**
)
&
dict
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_Keys
(
dict
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
keys
);
hr
=
IDictionary_Keys
(
dict
,
&
keys
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
keys
)
==
(
VT_ARRAY
|
VT_VARIANT
),
"got %d
\n
"
,
V_VT
(
&
keys
));
}
VariantClear
(
&
keys
);
V_VT
(
&
key
)
=
VT_R4
;
V_R4
(
&
key
)
=
0
.
0
;
VariantInit
(
&
item
);
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
keys
);
hr
=
IDictionary_Keys
(
dict
,
&
keys
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
keys
)
==
(
VT_ARRAY
|
VT_VARIANT
),
"got %d
\n
"
,
V_VT
(
&
keys
));
}
if
(
hr
==
S_OK
)
{
VariantInit
(
&
key
);
index
=
0
;
hr
=
SafeArrayGetElement
(
V_ARRAY
(
&
keys
),
&
index
,
&
key
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
V_VT
(
&
key
)
==
VT_R4
,
"got %d
\n
"
,
V_VT
(
&
key
));
index
=
SafeArrayGetDim
(
V_ARRAY
(
&
keys
));
ok
(
index
==
1
,
"got %d
\n
"
,
index
);
hr
=
SafeArrayGetUBound
(
V_ARRAY
(
&
keys
),
1
,
&
index
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
index
==
0
,
"got %d
\n
"
,
index
);
}
VariantClear
(
&
keys
);
IDictionary_Release
(
dict
);
}
static
void
test_Remove
(
void
)
{
VARIANT
key
,
item
;
IDictionary
*
dict
;
HRESULT
hr
;
hr
=
CoCreateInstance
(
&
CLSID_Dictionary
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_IDictionary
,
(
void
**
)
&
dict
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
if
(
0
)
hr
=
IDictionary_Remove
(
dict
,
NULL
);
/* nothing added yet */
V_VT
(
&
key
)
=
VT_R4
;
V_R4
(
&
key
)
=
0
.
0
;
hr
=
IDictionary_Remove
(
dict
,
&
key
);
todo_wine
ok
(
hr
==
CTL_E_ELEMENT_NOT_FOUND
,
"got 0x%08x
\n
"
,
hr
);
VariantInit
(
&
item
);
hr
=
IDictionary_Add
(
dict
,
&
key
,
&
item
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDictionary_Remove
(
dict
,
&
key
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IDictionary_Release
(
dict
);
}
START_TEST
(
dictionary
)
START_TEST
(
dictionary
)
{
{
IDispatch
*
disp
;
IDispatch
*
disp
;
...
@@ -433,6 +599,9 @@ START_TEST(dictionary)
...
@@ -433,6 +599,9 @@ START_TEST(dictionary)
test_interfaces
();
test_interfaces
();
test_comparemode
();
test_comparemode
();
test_hash_value
();
test_hash_value
();
test_Exists
();
test_Keys
();
test_Remove
();
CoUninitialize
();
CoUninitialize
();
}
}
dlls/scrrun/tests/scrrun.idl
View file @
94e5353f
...
@@ -24,7 +24,10 @@ cpp_quote("#undef CopyFile")
...
@@ -24,7 +24,10 @@ cpp_quote("#undef CopyFile")
cpp_quote
(
"#undef DeleteFile"
)
cpp_quote
(
"#undef DeleteFile"
)
cpp_quote
(
"#undef MoveFile"
)
cpp_quote
(
"#undef MoveFile"
)
cpp_quote
(
"#endif"
)
cpp_quote
(
"#endif"
)
cpp_quote
(
"#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)"
)
/*
this
is
not
defined
in
public
headers
*/
/*
this
is
not
defined
in
public
headers
*/
cpp_quote
(
"#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)"
)
cpp_quote
(
"#define CTL_E_KEY_ALREADY_EXISTS STD_CTL_SCODE(457)"
)
cpp_quote
(
"#define CTL_E_ELEMENT_NOT_FOUND STD_CTL_SCODE(32811)"
)
[
[
uuid
(
420B2830
-
E718
-
11
CF
-893D-00
A0C9054228
),
uuid
(
420B2830
-
E718
-
11
CF
-893D-00
A0C9054228
),
...
...
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