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
9a52a3e1
Commit
9a52a3e1
authored
Nov 08, 2017
by
Zebediah Figura
Committed by
Alexandre Julliard
Nov 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz/tests: Remove thread-counting tests.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c23bcce5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
75 deletions
+2
-75
avisplitter.c
dlls/quartz/tests/avisplitter.c
+2
-75
No files found.
dlls/quartz/tests/avisplitter.c
View file @
9a52a3e1
...
...
@@ -25,38 +25,8 @@
#include "dshow.h"
#include "tlhelp32.h"
static
HANDLE
(
WINAPI
*
pCreateToolhelp32Snapshot
)(
DWORD
,
DWORD
);
static
BOOL
(
WINAPI
*
pThread32First
)(
HANDLE
,
LPTHREADENTRY32
);
static
BOOL
(
WINAPI
*
pThread32Next
)(
HANDLE
,
LPTHREADENTRY32
);
static
IUnknown
*
pAviSplitter
=
NULL
;
static
int
count_threads
(
void
)
{
THREADENTRY32
te
;
int
threads
;
HANDLE
h
;
h
=
pCreateToolhelp32Snapshot
(
TH32CS_SNAPTHREAD
,
0
);
te
.
dwSize
=
sizeof
(
te
);
if
(
h
==
INVALID_HANDLE_VALUE
)
return
-
1
;
pThread32First
(
h
,
&
te
);
if
(
te
.
th32OwnerProcessID
==
GetCurrentProcessId
())
threads
=
1
;
else
threads
=
0
;
while
(
pThread32Next
(
h
,
&
te
))
if
(
te
.
th32OwnerProcessID
==
GetCurrentProcessId
())
++
threads
;
CloseHandle
(
h
);
return
threads
;
}
static
BOOL
create_avisplitter
(
void
)
{
HRESULT
hr
;
...
...
@@ -303,37 +273,19 @@ static void test_filesourcefilter(void)
static
const
WCHAR
wfile
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'.'
,
'a'
,
'v'
,
'i'
,
0
};
static
const
char
afile
[]
=
"test.avi"
;
/* This test doesn't use the quartz filtergraph because it makes it impossible
* to be certain that a thread is really one owned by the avi splitter.
* A lot of the decoder filters will also have their own thread, and Windows'
* filtergraph has a separate thread for start/stop/seeking requests.
* By avoiding the filtergraph altogether and connecting streams directly to
* the null renderer I am sure that this is not the case here.
*/
static
void
test_threads
(
void
)
static
void
test_filter_graph
(
void
)
{
IFileSourceFilter
*
pfile
=
NULL
;
IBaseFilter
*
preader
=
NULL
,
*
pavi
=
NULL
;
IEnumPins
*
enumpins
=
NULL
;
IPin
*
filepin
=
NULL
,
*
avipin
=
NULL
;
HRESULT
hr
;
int
baselevel
,
curlevel
,
expected
;
HANDLE
file
=
NULL
;
PIN_DIRECTION
dir
=
PINDIR_OUTPUT
;
char
buffer
[
13
];
DWORD
readbytes
;
FILTER_STATE
state
;
/* We need another way of counting threads on NT4. Skip these tests (for now) */
if
(
!
pCreateToolhelp32Snapshot
||
!
pThread32First
||
!
pThread32Next
)
{
win_skip
(
"Needed thread functions are not available (NT4)
\n
"
);
return
;
}
/* Before doing anything (the thread count at the start differs per OS) */
baselevel
=
count_threads
();
file
=
CreateFileW
(
wfile
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
...
...
@@ -409,20 +361,11 @@ static void test_threads(void)
if
(
hr
!=
S_OK
)
goto
fail
;
curlevel
=
count_threads
();
ok
(
curlevel
==
baselevel
,
"The thread count should be %d not %d
\n
"
,
baselevel
,
curlevel
);
hr
=
IPin_Connect
(
filepin
,
avipin
,
NULL
);
ok
(
hr
==
S_OK
,
"Could not connect: %08x
\n
"
,
hr
);
if
(
hr
!=
S_OK
)
goto
fail
;
expected
=
1
+
baselevel
;
curlevel
=
count_threads
();
ok
(
curlevel
==
expected
,
"The thread count should be %d not %d
\n
"
,
expected
,
curlevel
);
IPin_Release
(
avipin
);
avipin
=
NULL
;
...
...
@@ -462,7 +405,6 @@ static void test_threads(void)
break
;
}
IBaseFilter_Run
(
pnull
,
0
);
++
expected
;
}
IPin_Release
(
avipin
);
...
...
@@ -494,10 +436,6 @@ static void test_threads(void)
IBaseFilter_Run
(
pavi
,
0
);
IBaseFilter_GetState
(
pavi
,
INFINITE
,
&
state
);
curlevel
=
count_threads
();
ok
(
curlevel
==
expected
,
"The thread count should be %d not %d
\n
"
,
expected
,
curlevel
);
IBaseFilter_Pause
(
pavi
);
IBaseFilter_Pause
(
preader
);
IBaseFilter_Stop
(
pavi
);
...
...
@@ -568,21 +506,10 @@ fail:
IBaseFilter_Release
(
pavi
);
if
(
pfile
)
IFileSourceFilter_Release
(
pfile
);
curlevel
=
count_threads
();
todo_wine
ok
(
curlevel
==
baselevel
,
"The thread count should be %d not %d
\n
"
,
baselevel
,
curlevel
);
}
START_TEST
(
avisplitter
)
{
HMODULE
kernel32
=
GetModuleHandleA
(
"kernel32.dll"
);
pCreateToolhelp32Snapshot
=
(
void
*
)
GetProcAddress
(
kernel32
,
"CreateToolhelp32Snapshot"
);
pThread32First
=
(
void
*
)
GetProcAddress
(
kernel32
,
"Thread32First"
);
pThread32Next
=
(
void
*
)
GetProcAddress
(
kernel32
,
"Thread32Next"
);
CoInitialize
(
NULL
);
if
(
!
create_avisplitter
())
...
...
@@ -594,7 +521,7 @@ START_TEST(avisplitter)
test_query_interface
();
test_basefilter
();
test_filesourcefilter
();
test_
threads
();
test_
filter_graph
();
release_avisplitter
();
...
...
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