Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f285b460
Commit
f285b460
authored
Feb 17, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Some tests for record-based safearray copy.
parent
a34e52cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
safearray.c
dlls/oleaut32/tests/safearray.c
+27
-9
No files found.
dlls/oleaut32/tests/safearray.c
View file @
f285b460
...
@@ -79,8 +79,9 @@ typedef struct IRecordInfoImpl
...
@@ -79,8 +79,9 @@ typedef struct IRecordInfoImpl
{
{
IRecordInfo
IRecordInfo_iface
;
IRecordInfo
IRecordInfo_iface
;
LONG
ref
;
LONG
ref
;
DWORD
sizeCalled
;
unsigned
int
sizeCalled
;
DWORD
clearCalled
;
unsigned
int
clearCalled
;
unsigned
int
recordcopy
;
}
IRecordInfoImpl
;
}
IRecordInfoImpl
;
static
inline
IRecordInfoImpl
*
impl_from_IRecordInfo
(
IRecordInfo
*
iface
)
static
inline
IRecordInfoImpl
*
impl_from_IRecordInfo
(
IRecordInfo
*
iface
)
...
@@ -137,8 +138,9 @@ static HRESULT WINAPI RecordInfo_RecordClear(IRecordInfo *iface, PVOID pvExistin
...
@@ -137,8 +138,9 @@ static HRESULT WINAPI RecordInfo_RecordClear(IRecordInfo *iface, PVOID pvExistin
static
HRESULT
WINAPI
RecordInfo_RecordCopy
(
IRecordInfo
*
iface
,
PVOID
pvExisting
,
PVOID
pvNew
)
static
HRESULT
WINAPI
RecordInfo_RecordCopy
(
IRecordInfo
*
iface
,
PVOID
pvExisting
,
PVOID
pvNew
)
{
{
ok
(
0
,
"unexpected call
\n
"
);
IRecordInfoImpl
*
This
=
impl_from_IRecordInfo
(
iface
);
return
E_NOTIMPL
;
This
->
recordcopy
++
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
RecordInfo_GetGuid
(
IRecordInfo
*
iface
,
GUID
*
pguid
)
static
HRESULT
WINAPI
RecordInfo_GetGuid
(
IRecordInfo
*
iface
,
GUID
*
pguid
)
...
@@ -1590,7 +1592,7 @@ static void test_SafeArrayCreateEx(void)
...
@@ -1590,7 +1592,7 @@ static void test_SafeArrayCreateEx(void)
/* Win32 doesn't care if GetSize fails */
/* Win32 doesn't care if GetSize fails */
fail_GetSize
=
TRUE
;
fail_GetSize
=
TRUE
;
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
iRec
);
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
&
iRec
->
IRecordInfo_iface
);
ok
(
sa
!=
NULL
,
"CreateEx (Fail Size) failed
\n
"
);
ok
(
sa
!=
NULL
,
"CreateEx (Fail Size) failed
\n
"
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
1
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
1
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
sizeCalled
==
1
,
"GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
ok
(
iRec
->
sizeCalled
==
1
,
"GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
...
@@ -1609,7 +1611,7 @@ static void test_SafeArrayCreateEx(void)
...
@@ -1609,7 +1611,7 @@ static void test_SafeArrayCreateEx(void)
iRec
->
ref
=
START_REF_COUNT
;
iRec
->
ref
=
START_REF_COUNT
;
iRec
->
sizeCalled
=
0
;
iRec
->
sizeCalled
=
0
;
iRec
->
clearCalled
=
0
;
iRec
->
clearCalled
=
0
;
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
iRec
);
sa
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
&
iRec
->
IRecordInfo_iface
);
ok
(
sa
!=
NULL
,
"CreateEx (Rec) failed
\n
"
);
ok
(
sa
!=
NULL
,
"CreateEx (Rec) failed
\n
"
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
1
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
1
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
sizeCalled
==
1
,
"GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
ok
(
iRec
->
sizeCalled
==
1
,
"GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
...
@@ -1617,19 +1619,35 @@ static void test_SafeArrayCreateEx(void)
...
@@ -1617,19 +1619,35 @@ static void test_SafeArrayCreateEx(void)
if
(
sa
&&
pSafeArrayGetRecordInfo
)
if
(
sa
&&
pSafeArrayGetRecordInfo
)
{
{
IRecordInfo
*
saRec
=
NULL
;
IRecordInfo
*
saRec
=
NULL
;
hres
=
pSafeArrayGetRecordInfo
(
sa
,
&
saRec
)
;
SAFEARRAY
*
sacopy
;
hres
=
pSafeArrayGetRecordInfo
(
sa
,
&
saRec
);
ok
(
hres
==
S_OK
,
"GRI failed
\n
"
);
ok
(
hres
==
S_OK
,
"GRI failed
\n
"
);
ok
(
saRec
==
&
iRec
->
IRecordInfo_iface
,
"Different saRec
\n
"
);
ok
(
saRec
==
&
iRec
->
IRecordInfo_iface
,
"Different saRec
\n
"
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
2
,
"Didn't AddRef %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
ref
==
START_REF_COUNT
+
2
,
"Didn't AddRef %d
\n
"
,
iRec
->
ref
);
if
(
iRec
->
ref
==
START_REF_COUNT
+
2
)
IRecordInfo_Release
(
saRec
);
IRecordInfo_Release
(
saRec
);
ok
(
sa
->
cbElements
==
RECORD_SIZE
,
"Elemsize is %d
\n
"
,
sa
->
cbElements
);
ok
(
sa
->
cbElements
==
RECORD_SIZE
,
"Elemsize is %d
\n
"
,
sa
->
cbElements
);
/* try to copy record based arrays */
sacopy
=
pSafeArrayCreateEx
(
VT_RECORD
,
1
,
sab
,
&
iRec
->
IRecordInfo_iface
);
iRec
->
recordcopy
=
0
;
iRec
->
clearCalled
=
0
;
/* array copy code doesn't explicitely clear a record */
hres
=
SafeArrayCopyData
(
sa
,
sacopy
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
todo_wine
{
ok
(
iRec
->
recordcopy
==
sab
[
0
].
cElements
,
"got %d
\n
"
,
iRec
->
recordcopy
);
ok
(
iRec
->
clearCalled
==
0
,
"got %d
\n
"
,
iRec
->
clearCalled
);
}
hres
=
SafeArrayDestroy
(
sacopy
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
iRec
->
clearCalled
=
0
;
iRec
->
sizeCalled
=
0
;
hres
=
SafeArrayDestroy
(
sa
);
hres
=
SafeArrayDestroy
(
sa
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
hres
==
S_OK
,
"got 0x%08x
\n
"
,
hres
);
ok
(
iRec
->
sizeCalled
==
1
,
"Destroy->GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
ok
(
iRec
->
sizeCalled
==
0
,
"Destroy->GetSize called %d times
\n
"
,
iRec
->
sizeCalled
);
ok
(
iRec
->
clearCalled
==
sab
[
0
].
cElements
,
"Destroy->Clear called %d times
\n
"
,
iRec
->
clearCalled
);
ok
(
iRec
->
clearCalled
==
sab
[
0
].
cElements
,
"Destroy->Clear called %d times
\n
"
,
iRec
->
clearCalled
);
ok
(
iRec
->
ref
==
START_REF_COUNT
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
ok
(
iRec
->
ref
==
START_REF_COUNT
,
"Wrong iRec refcount %d
\n
"
,
iRec
->
ref
);
}
}
...
...
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