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
598f3f06
Commit
598f3f06
authored
Feb 24, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Test for internal safearray data layout.
parent
a4e0fc95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
safearray.c
dlls/oleaut32/tests/safearray.c
+58
-0
No files found.
dlls/oleaut32/tests/safearray.c
View file @
598f3f06
...
...
@@ -2003,6 +2003,63 @@ static void test_SafeArrayDestroyData (void)
ok
(
hres
==
S_OK
,
"SAD failed, error code %x.
\n
"
,
hres
);
}
static
void
test_safearray_layout
(
void
)
{
IRecordInfoImpl
*
irec
;
IRecordInfo
*
record
;
GUID
guid
,
*
guidptr
;
SAFEARRAYBOUND
sab
;
SAFEARRAY
*
sa
;
DWORD
*
dwptr
;
HRESULT
hr
;
sab
.
lLbound
=
0
;
sab
.
cElements
=
10
;
/* GUID field */
sa
=
SafeArrayCreate
(
VT_UNKNOWN
,
1
,
&
sab
);
ok
(
sa
!=
NULL
,
"got %p
\n
"
,
sa
);
guidptr
=
(
GUID
*
)
sa
-
1
;
ok
(
IsEqualIID
(
guidptr
,
&
IID_IUnknown
),
"got %s
\n
"
,
wine_dbgstr_guid
(
guidptr
));
hr
=
SafeArraySetIID
(
sa
,
&
IID_IDispatch
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualIID
(
guidptr
,
&
IID_IDispatch
),
"got %s
\n
"
,
wine_dbgstr_guid
(
guidptr
));
memcpy
(
guidptr
,
&
IID_IUnknown
,
sizeof
(
GUID
));
hr
=
SafeArrayGetIID
(
sa
,
&
guid
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
IsEqualIID
(
&
guid
,
&
IID_IUnknown
),
"got %s
\n
"
,
wine_dbgstr_guid
(
&
guid
));
hr
=
SafeArrayDestroy
(
sa
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* VARTYPE field */
sa
=
SafeArrayCreate
(
VT_UI1
,
1
,
&
sab
);
ok
(
sa
!=
NULL
,
"got %p
\n
"
,
sa
);
dwptr
=
(
DWORD
*
)
sa
-
1
;
ok
(
*
dwptr
==
VT_UI1
,
"got %d
\n
"
,
*
dwptr
);
hr
=
SafeArrayDestroy
(
sa
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
/* IRecordInfo pointer */
irec
=
IRecordInfoImpl_Construct
();
irec
->
ref
=
1
;
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
&
sab
,
&
irec
->
IRecordInfo_iface
);
ok
(
sa
!=
NULL
,
"failed to create array
\n
"
);
record
=
*
((
IRecordInfo
**
)
sa
-
1
);
ok
(
record
==
&
irec
->
IRecordInfo_iface
,
"got %p
\n
"
,
record
);
hr
=
SafeArrayDestroy
(
sa
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
IRecordInfo_Release
(
&
irec
->
IRecordInfo_iface
);
}
START_TEST
(
safearray
)
{
hOleaut32
=
GetModuleHandleA
(
"oleaut32.dll"
);
...
...
@@ -2035,4 +2092,5 @@ START_TEST(safearray)
test_SafeArrayGetPutElement_IUnknown
();
test_SafeArrayRedim_IUnknown
();
test_SafeArrayGetPutElement_VARIANT
();
test_safearray_layout
();
}
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