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
01739483
Commit
01739483
authored
Jun 14, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 15, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Add a test for mutexes.
parent
3fa7fa5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
sync.c
dlls/kernel/tests/sync.c
+27
-0
No files found.
dlls/kernel/tests/sync.c
View file @
01739483
...
...
@@ -126,7 +126,34 @@ static void test_signalandwait(void)
CloseHandle
(
file
);
}
static
void
test_mutex
(
void
)
{
DWORD
wait_ret
;
BOOL
ret
;
HANDLE
hCreated
;
HANDLE
hOpened
;
hCreated
=
CreateMutex
(
NULL
,
FALSE
,
"WineTestMutex"
);
ok
(
hCreated
!=
NULL
,
"CreateMutex failed with error %ld
\n
"
,
GetLastError
());
wait_ret
=
WaitForSingleObject
(
hCreated
,
INFINITE
);
ok
(
wait_ret
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed with error 0x%08lx
\n
"
,
wait_ret
);
/* yes, opening with just READ_CONTROL access allows us to successfully
* call ReleaseMutex */
hOpened
=
OpenMutex
(
READ_CONTROL
,
FALSE
,
"WineTestMutex"
);
ok
(
hOpened
!=
NULL
,
"OpenMutex failed with error %ld
\n
"
,
GetLastError
());
ret
=
ReleaseMutex
(
hOpened
);
todo_wine
ok
(
ret
,
"ReleaseMutex failed with error %ld
\n
"
,
GetLastError
());
ret
=
ReleaseMutex
(
hCreated
);
todo_wine
ok
(
!
ret
&&
(
GetLastError
()
==
ERROR_NOT_OWNER
),
"ReleaseMutex should have failed with ERROR_NOT_OWNER instead of %ld
\n
"
,
GetLastError
());
CloseHandle
(
hOpened
);
CloseHandle
(
hCreated
);
}
START_TEST
(
sync
)
{
test_signalandwait
();
test_mutex
();
}
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