Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gabriel Ivăncescu
wine
Commits
2af11b6e
Commit
2af11b6e
authored
2 years ago
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
pdh/tests: Add PdhVbGetDoubleCounterValue() tests.
parent
e1c59cc5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/pdh/tests/pdh.c
+44
-0
44 additions, 0 deletions
dlls/pdh/tests/pdh.c
with
44 additions
and
0 deletions
dlls/pdh/tests/pdh.c
+
44
−
0
View file @
2af11b6e
...
...
@@ -34,6 +34,7 @@ static PDH_STATUS (WINAPI *pPdhAddEnglishCounterW)(PDH_HQUERY, LPCWSTR, DWORD_
static
PDH_STATUS
(
WINAPI
*
pPdhCollectQueryDataWithTime
)(
PDH_HQUERY
,
LONGLONG
*
);
static
PDH_STATUS
(
WINAPI
*
pPdhValidatePathExA
)(
PDH_HLOG
,
LPCSTR
);
static
PDH_STATUS
(
WINAPI
*
pPdhValidatePathExW
)(
PDH_HLOG
,
LPCWSTR
);
static
double
(
WINAPI
*
pPdhVbGetDoubleCounterValue
)(
PDH_HCOUNTER
,
PDH_STATUS
*
);
#define GETFUNCPTR(func) p##func = (void *)GetProcAddress( pdh, #func );
...
...
@@ -69,6 +70,7 @@ static void init_function_ptrs( void )
GETFUNCPTR
(
PdhCollectQueryDataWithTime
)
GETFUNCPTR
(
PdhValidatePathExA
)
GETFUNCPTR
(
PdhValidatePathExW
)
GETFUNCPTR
(
PdhVbGetDoubleCounterValue
)
}
static
const
WCHAR
processor_time
[]
=
L"% Processor Time"
;
...
...
@@ -424,6 +426,46 @@ static void test_PdhGetRawCounterValue( void )
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08lx
\n
"
,
ret
);
}
static
void
test_PdhVbGetDoubleCounterValue
(
void
)
{
PDH_FMT_COUNTERVALUE
value
;
PDH_HCOUNTER
counter
;
PDH_STATUS
status
;
PDH_HQUERY
query
;
double
ret
;
status
=
PdhOpenQueryA
(
NULL
,
0
,
&
query
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhOpenQueryA failed 0x%08lx
\n
"
,
status
);
status
=
PdhAddCounterA
(
query
,
"
\\
System
\\
System Up Time"
,
0
,
&
counter
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhAddCounterA failed 0x%08lx
\n
"
,
status
);
status
=
PdhCollectQueryData
(
query
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhCollectQueryData failed 0x%08lx
\n
"
,
status
);
status
=
PdhGetFormattedCounterValue
(
counter
,
PDH_FMT_DOUBLE
,
NULL
,
&
value
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhGetFormattedCounterValue failed 0x%08lx
\n
"
,
status
);
ret
=
pPdhVbGetDoubleCounterValue
(
NULL
,
NULL
);
ok
(
ret
==
0
.
0
,
"Unexpected value %f
\n
"
,
ret
);
status
=
PDH_FUNCTION_NOT_FOUND
;
ret
=
pPdhVbGetDoubleCounterValue
(
NULL
,
&
status
);
ok
(
status
==
PDH_INVALID_HANDLE
,
"PdhVbGetDoubleCounterValue failed 0x%08lx
\n
"
,
status
);
ok
(
ret
==
0
.
0
,
"Unexpected value %f
\n
"
,
ret
);
ret
=
pPdhVbGetDoubleCounterValue
(
counter
,
NULL
);
ok
(
ret
==
value
.
doubleValue
,
"Unexpected value %f
\n
"
,
ret
);
status
=
PDH_FUNCTION_NOT_FOUND
;
ret
=
pPdhVbGetDoubleCounterValue
(
counter
,
&
status
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhVbGetDoubleCounterValue failed 0x%08lx
\n
"
,
status
);
ok
(
ret
==
value
.
doubleValue
,
"Unexpected value %f
\n
"
,
ret
);
status
=
PdhCloseQuery
(
query
);
ok
(
status
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08lx
\n
"
,
status
);
}
static
void
test_PdhSetCounterScaleFactor
(
void
)
{
PDH_STATUS
ret
;
...
...
@@ -998,6 +1040,8 @@ START_TEST(pdh)
test_PdhSetCounterScaleFactor
();
test_PdhGetCounterTimeBase
();
test_PdhVbGetDoubleCounterValue
();
test_PdhGetCounterInfoA
();
test_PdhGetCounterInfoW
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment