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
02a810f1
Commit
02a810f1
authored
Oct 28, 2005
by
Saulius Krasuckas
Committed by
Alexandre Julliard
Oct 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for GetThreadExitCode.
Use GetModuleHandleA as kernel32 should be present on every system.
parent
f86c4e8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
thread.c
dlls/kernel/tests/thread.c
+24
-2
No files found.
dlls/kernel/tests/thread.c
View file @
02a810f1
...
@@ -567,14 +567,35 @@ static VOID test_thread_processor(void)
...
@@ -567,14 +567,35 @@ static VOID test_thread_processor(void)
}
}
}
}
static
VOID
test_GetThreadExitCode
(
void
)
{
DWORD
exitCode
,
threadid
;
DWORD
GLE
,
ret
;
HANDLE
thread
;
ret
=
GetExitCodeThread
((
HANDLE
)
0x2bad2bad
,
&
exitCode
);
ok
(
ret
==
0
,
"GetExitCodeThread returned non zero value: %ld
\n
"
,
ret
);
GLE
=
GetLastError
();
ok
(
GLE
==
ERROR_INVALID_HANDLE
,
"GetLastError returned %ld (expected 6)
\n
"
,
GLE
);
thread
=
CreateThread
(
NULL
,
0
,
threadFunc2
,
NULL
,
0
,
&
threadid
);
ret
=
WaitForSingleObject
(
thread
,
100
);
ok
(
ret
==
WAIT_OBJECT_0
,
"threadFunc2 did not exit during 100 ms
\n
"
);
ret
=
GetExitCodeThread
(
thread
,
&
exitCode
);
ok
(
ret
==
exitCode
||
ret
==
1
,
"GetExitCodeThread returned %ld (expected 1 or %ld)
\n
"
,
ret
,
exitCode
);
ok
(
exitCode
==
99
,
"threadFunc2 exited with code %ld (expected 99)
\n
"
,
exitCode
);
ok
(
CloseHandle
(
thread
)
!=
0
,
"Error closing thread handle
\n
"
);
}
START_TEST
(
thread
)
START_TEST
(
thread
)
{
{
HINSTANCE
lib
;
HINSTANCE
lib
;
/* Neither Cygwin nor mingW export OpenThread, so do a dynamic check
/* Neither Cygwin nor mingW export OpenThread, so do a dynamic check
so that the compile passes
so that the compile passes
*/
*/
lib
=
LoadLibraryA
(
"kernel32
"
);
lib
=
GetModuleHandleA
(
"kernel32.dll
"
);
ok
(
lib
!=
NULL
,
"Couldn't
load
kernel32.dll
\n
"
);
ok
(
lib
!=
NULL
,
"Couldn't
get a handle for
kernel32.dll
\n
"
);
pGetThreadPriorityBoost
=
(
GetThreadPriorityBoost_t
)
GetProcAddress
(
lib
,
"GetThreadPriorityBoost"
);
pGetThreadPriorityBoost
=
(
GetThreadPriorityBoost_t
)
GetProcAddress
(
lib
,
"GetThreadPriorityBoost"
);
pOpenThread
=
(
OpenThread_t
)
GetProcAddress
(
lib
,
"OpenThread"
);
pOpenThread
=
(
OpenThread_t
)
GetProcAddress
(
lib
,
"OpenThread"
);
pSetThreadIdealProcessor
=
(
SetThreadIdealProcessor_t
)
GetProcAddress
(
lib
,
"SetThreadIdealProcessor"
);
pSetThreadIdealProcessor
=
(
SetThreadIdealProcessor_t
)
GetProcAddress
(
lib
,
"SetThreadIdealProcessor"
);
...
@@ -587,4 +608,5 @@ START_TEST(thread)
...
@@ -587,4 +608,5 @@ START_TEST(thread)
test_thread_priority
();
test_thread_priority
();
test_GetThreadTimes
();
test_GetThreadTimes
();
test_thread_processor
();
test_thread_processor
();
test_GetThreadExitCode
();
}
}
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