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
5dfc2ead
Commit
5dfc2ead
authored
Jul 09, 2007
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 10, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdh: Add tests for Pdh{Add, Remove}Counter and PdhCollectQueryData.
parent
bdb218ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
pdh.c
dlls/pdh/tests/pdh.c
+48
-0
No files found.
dlls/pdh/tests/pdh.c
View file @
5dfc2ead
...
...
@@ -48,7 +48,55 @@ static void test_open_close_query( void )
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08x
\n
"
,
ret
);
}
static
void
test_add_remove_counter
(
void
)
{
PDH_STATUS
ret
;
PDH_HQUERY
query
;
PDH_HCOUNTER
counter
;
ret
=
PdhOpenQueryA
(
NULL
,
0
,
&
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhOpenQueryA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
NULL
,
"
\\
System
\\
System Up Time"
,
0
,
NULL
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
NULL
,
"
\\
System
\\
System Up Time"
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
query
,
NULL
,
0
,
&
counter
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
query
,
"
\\
System
\\
System Up Time"
,
0
,
NULL
);
ok
(
ret
==
PDH_INVALID_ARGUMENT
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhAddCounterA
(
query
,
"
\\
System
\\
System Down Time"
,
0
,
&
counter
);
ok
(
ret
==
PDH_CSTATUS_NO_COUNTER
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ok
(
!
counter
,
"PdhAddCounterA failed %p
\n
"
,
counter
);
ret
=
PdhAddCounterA
(
query
,
"
\\
System
\\
System Up Time"
,
0
,
&
counter
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhAddCounterA failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
NULL
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
counter
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCollectQueryData
(
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCollectQueryData failed 0x%08x
\n
"
,
ret
);
ret
=
PdhRemoveCounter
(
NULL
);
ok
(
ret
==
PDH_INVALID_HANDLE
,
"PdhRemoveCounter failed 0x%08x
\n
"
,
ret
);
ret
=
PdhRemoveCounter
(
counter
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhRemoveCounter failed 0x%08x
\n
"
,
ret
);
ret
=
PdhCloseQuery
(
query
);
ok
(
ret
==
ERROR_SUCCESS
,
"PdhCloseQuery failed 0x%08x
\n
"
,
ret
);
}
START_TEST
(
pdh
)
{
test_open_close_query
();
test_add_remove_counter
();
}
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