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
25ab9f2c
Commit
25ab9f2c
authored
May 20, 2005
by
Richard Cohen
Committed by
Alexandre Julliard
May 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if VT_R8 and VT_INT_PTR are supported before testing them.
parent
e0883970
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
safearray.c
dlls/oleaut32/tests/safearray.c
+34
-8
No files found.
dlls/oleaut32/tests/safearray.c
View file @
25ab9f2c
...
...
@@ -57,10 +57,15 @@ static SAFEARRAY* (WINAPI *pSafeArrayCreateVector)(VARTYPE,LONG,ULONG);
/* Have IRecordInfo data type? */
#define HAVE_OLEAUT32_RECORD HAVE_FUNC(SafeArraySetRecordInfo)
/* Have R8 data type? */
#define HAVE_OLEAUT32_R8 HAVE_FUNC(VarR8FromI1)
/* Have I8/UI8 data type? */
#define HAVE_OLEAUT32_I8 HAVE_FUNC(VarI8FromI1)
/* Have the decimal type? */
#define HAVE_OLEAUT32_DECIMAL HAVE_FUNC(VarDecAdd)
/* Have INT_PTR/UINT_PTR type? */
BOOL
HAVE_OLEAUT32_INT_PTR
;
/* very old version? */
#define IS_ANCIENT (!HAVE_FUNC(VarI1FromI2))
...
...
@@ -169,6 +174,8 @@ static DWORD SAFEARRAY_GetVTSize(VARTYPE vt)
case
VT_R4
:
case
VT_ERROR
:
return
sizeof
(
LONG
);
case
VT_R8
:
if
(
HAVE_OLEAUT32_R8
)
return
sizeof
(
LONG64
);
case
VT_I8
:
case
VT_UI8
:
if
(
HAVE_OLEAUT32_I8
)
...
...
@@ -177,7 +184,10 @@ static DWORD SAFEARRAY_GetVTSize(VARTYPE vt)
case
VT_INT
:
case
VT_UINT
:
return
sizeof
(
INT
);
case
VT_INT_PTR
:
case
VT_UINT_PTR
:
return
sizeof
(
UINT_PTR
);
case
VT_UINT_PTR
:
if
(
HAVE_OLEAUT32_INT_PTR
)
return
sizeof
(
UINT_PTR
);
break
;
case
VT_CY
:
return
sizeof
(
CY
);
case
VT_DATE
:
return
sizeof
(
DATE
);
case
VT_BSTR
:
return
sizeof
(
BSTR
);
...
...
@@ -192,6 +202,26 @@ static DWORD SAFEARRAY_GetVTSize(VARTYPE vt)
return
0
;
}
static
void
check_for_VT_INT_PTR
(
void
)
{
/* Set a global flag if VT_INT_PTR is supported */
SAFEARRAY
*
a
;
SAFEARRAYBOUND
bound
;
bound
.
cElements
=
0
;
bound
.
lLbound
=
0
;
a
=
SafeArrayCreate
(
VT_INT_PTR
,
1
,
&
bound
);
if
(
a
)
{
trace
(
"VT_INT_PTR is supported
\n
"
);
HAVE_OLEAUT32_INT_PTR
=
TRUE
;
SafeArrayDestroy
(
a
);
}
else
{
trace
(
"VT_INT_PTR is not supported
\n
"
);
HAVE_OLEAUT32_INT_PTR
=
FALSE
;
}
}
#define VARTYPE_NOT_SUPPORTED 0
static
struct
{
VARTYPE
vt
;
/* VT */
...
...
@@ -674,8 +704,7 @@ static void test_SafeArrayCreateLockDestroy(void)
if
(
dwLen
)
ok
(
sa
||
(
IS_ANCIENT
&&
(
vt
==
VT_DECIMAL
||
vt
==
VT_I1
||
vt
==
VT_UI2
||
vt
==
VT_UI4
||
vt
==
VT_INT
||
vt
==
VT_UINT
||
vt
==
VT_UINT_PTR
||
vt
==
VT_INT_PTR
)),
vt
==
VT_UI4
||
vt
==
VT_INT
||
vt
==
VT_UINT
)),
"VARTYPE %d (@%d dimensions) failed
\n
"
,
vt
,
dimension
);
else
ok
(
sa
==
NULL
||
vt
==
VT_R8
,
...
...
@@ -778,11 +807,7 @@ static void test_VectorCreateLockDestroy(void)
sa
=
pSafeArrayCreateVector
(
vt
,
0
,
element
);
if
(
dwLen
)
{
/* win2000 has a bug where U/INT_PTR aren't accepted */
ok
(
sa
!=
NULL
||
vt
==
VT_INT_PTR
||
vt
==
VT_UINT_PTR
,
"VARTYPE %d (@%d elements) failed
\n
"
,
vt
,
element
);
}
ok
(
sa
!=
NULL
,
"VARTYPE %d (@%d elements) failed
\n
"
,
vt
,
element
);
else
ok
(
sa
==
NULL
,
"VARTYPE %d (@%d elements) succeeded!
\n
"
,
vt
,
element
);
...
...
@@ -1586,6 +1611,7 @@ START_TEST(safearray)
GETPTR
(
SafeArrayCreateEx
);
GETPTR
(
SafeArrayCreateVector
);
check_for_VT_INT_PTR
();
test_safearray
();
test_SafeArrayAllocDestroyDescriptor
();
test_SafeArrayCreateLockDestroy
();
...
...
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