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
70930fa1
Commit
70930fa1
authored
Sep 18, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add 0-length read tests for a pipe.
parent
0c024503
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
pipe.c
dlls/kernel32/tests/pipe.c
+50
-0
No files found.
dlls/kernel32/tests/pipe.c
View file @
70930fa1
...
...
@@ -21,6 +21,8 @@
#include <stdarg.h>
#include <stdio.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <winsock.h>
...
...
@@ -1855,6 +1857,54 @@ static void test_readfileex_pending(void)
ok
(
completion_errorcode
==
0
,
"completion called with error %x
\n
"
,
completion_errorcode
);
ok
(
completion_lpoverlapped
==
&
overlapped
,
"completion called with wrong overlapped pointer
\n
"
);
num_bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
read_buf
,
0
,
&
num_bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
());
ok
(
num_bytes
==
0
,
"expected 0, got %u
\n
"
,
num_bytes
);
S
(
U
(
overlapped
)).
Offset
=
0
;
S
(
U
(
overlapped
)).
OffsetHigh
=
0
;
overlapped
.
Internal
=
-
1
;
overlapped
.
InternalHigh
=
-
1
;
overlapped
.
hEvent
=
event
;
num_bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
server
,
read_buf
,
0
,
&
num_bytes
,
&
overlapped
);
todo_wine
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"expected ERROR_IO_PENDING, got %d
\n
"
,
GetLastError
());
ok
(
num_bytes
==
0
,
"bytes %u
\n
"
,
num_bytes
);
todo_wine
ok
((
NTSTATUS
)
overlapped
.
Internal
==
STATUS_PENDING
,
"expected STATUS_PENDING, got %#lx
\n
"
,
overlapped
.
Internal
);
ok
(
overlapped
.
InternalHigh
==
-
1
,
"expected -1, got %lu
\n
"
,
overlapped
.
InternalHigh
);
wait
=
WaitForSingleObject
(
event
,
100
);
todo_wine
ok
(
wait
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %x
\n
"
,
wait
);
num_bytes
=
0xdeadbeef
;
ret
=
WriteFile
(
client
,
test_string
,
1
,
&
num_bytes
,
NULL
);
ok
(
ret
,
"WriteFile failed
\n
"
);
ok
(
num_bytes
==
1
,
"bytes %u
\n
"
,
num_bytes
);
wait
=
WaitForSingleObject
(
event
,
0
);
ok
(
wait
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %x
\n
"
,
wait
);
ok
(
num_bytes
==
1
,
"bytes %u
\n
"
,
num_bytes
);
todo_wine
ok
((
NTSTATUS
)
overlapped
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
overlapped
.
Internal
);
todo_wine
ok
(
overlapped
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
overlapped
.
InternalHigh
);
/* read the pending byte and clear the pipe */
num_bytes
=
0xdeadbeef
;
ret
=
ReadFile
(
server
,
read_buf
,
1
,
&
num_bytes
,
&
overlapped
);
ok
(
ret
,
"ReadFile failed
\n
"
);
ok
(
num_bytes
==
1
,
"bytes %u
\n
"
,
num_bytes
);
CloseHandle
(
client
);
CloseHandle
(
server
);
CloseHandle
(
event
);
...
...
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