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
c31ead47
Commit
c31ead47
authored
Aug 17, 2007
by
Paul Vriens
Committed by
Alexandre Julliard
Aug 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32/tests: Use GetModuleHandle and check only once for availability of some functions.
parent
7475599b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
vartest.c
dlls/oleaut32/tests/vartest.c
+18
-9
No files found.
dlls/oleaut32/tests/vartest.c
View file @
c31ead47
...
...
@@ -51,17 +51,12 @@ static INT (WINAPI *pVariantTimeToDosDateTime)(double,USHORT*,USHORT *);
#define CHECKPTR(func) p##func = (void*)GetProcAddress(hOleaut32, #func); \
if (!p##func) { trace("function " # func " not available, not testing it\n"); return; }
/* Is a given function exported from oleaut32? */
#define HAVE_FUNC(func) ((void*)GetProcAddress(hOleaut32, #func) != NULL)
/* Have IRecordInfo data type? */
#define HAVE_OLEAUT32_RECORD HAVE_FUNC(SafeArraySetRecordInfo)
/* Have CY data type? */
#define HAVE_OLEAUT32_CY HAVE_FUNC(VarCyAdd)
static
int
HAVE_OLEAUT32_RECORD
=
0
;
/* Have I8/UI8 data type? */
#define HAVE_OLEAUT32_I8 HAVE_FUNC(VarI8FromI1)
static
int
HAVE_OLEAUT32_I8
=
0
;
/* Is this an ancient version with support for only I2/I4/R4/R8/DATE? */
#define IS_ANCIENT (!HAVE_FUNC(VarI1FromI2))
static
int
IS_ANCIENT
=
0
;
/* When comparing floating point values we cannot expect an exact match
* because the rounding errors depend on the exact algorithm.
...
...
@@ -99,6 +94,20 @@ static INT (WINAPI *pVariantTimeToDosDateTime)(double,USHORT*,USHORT *);
#define R8_MAX DBL_MAX
#define R8_MIN DBL_MIN
static
void
init
(
void
)
{
hOleaut32
=
GetModuleHandle
(
"oleaut32.dll"
);
/* Is a given function exported from oleaut32? */
#define HAVE_FUNC(func) ((void*)GetProcAddress(hOleaut32, #func) != NULL)
HAVE_OLEAUT32_I8
=
HAVE_FUNC
(
VarI8FromI1
);
HAVE_OLEAUT32_RECORD
=
HAVE_FUNC
(
SafeArraySetRecordInfo
);
IS_ANCIENT
=
(
!
HAVE_FUNC
(
VarI1FromI2
));
#undef HAVE_FUNC
}
/* Functions to set a DECIMAL */
static
void
setdec
(
DECIMAL
*
dec
,
BYTE
scl
,
BYTE
sgn
,
ULONG
hi32
,
ULONG64
lo64
)
{
...
...
@@ -8203,7 +8212,7 @@ static void test_VarImp(void)
START_TEST
(
vartest
)
{
hOleaut32
=
LoadLibraryA
(
"oleaut32.dll"
);
init
(
);
test_VariantInit
();
test_VariantClear
();
...
...
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