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
e4551eee
Commit
e4551eee
authored
Sep 04, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Sep 04, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add basic tests for partially received pipe messages (ERROR_MORE_DATA).
parent
36debbe8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
pipe.c
dlls/kernel32/tests/pipe.c
+59
-0
No files found.
dlls/kernel32/tests/pipe.c
View file @
e4551eee
...
...
@@ -160,6 +160,65 @@ static void test_CreateNamedPipe(int pipemode)
ok
(
readden
==
sizeof
(
obuf2
),
"read 2 got %d bytes
\n
"
,
readden
);
ok
(
memcmp
(
obuf2
,
ibuf
,
written
)
==
0
,
"content 2 check
\n
"
);
/* Test how ReadFile behaves when the buffer is not big enough for the whole message */
memset
(
ibuf
,
0
,
sizeof
(
ibuf
));
ok
(
WriteFile
(
hnp
,
obuf2
,
sizeof
(
obuf2
),
&
written
,
NULL
),
"WriteFile
\n
"
);
ok
(
written
==
sizeof
(
obuf2
),
"write file len
\n
"
);
ok
(
ReadFile
(
hFile
,
ibuf
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
ok
(
readden
==
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
ReadFile
(
hFile
,
ibuf
+
4
,
sizeof
(
ibuf
)
-
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
ok
(
readden
==
sizeof
(
obuf2
)
-
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
memcmp
(
obuf2
,
ibuf
,
written
)
==
0
,
"content check
\n
"
);
memset
(
ibuf
,
0
,
sizeof
(
ibuf
));
ok
(
WriteFile
(
hFile
,
obuf
,
sizeof
(
obuf
),
&
written
,
NULL
),
"WriteFile
\n
"
);
ok
(
written
==
sizeof
(
obuf
),
"write file len
\n
"
);
if
(
pipemode
==
PIPE_TYPE_BYTE
)
{
ok
(
ReadFile
(
hnp
,
ibuf
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
}
else
{
SetLastError
(
0xdeadbeef
);
todo_wine
ok
(
!
ReadFile
(
hnp
,
ibuf
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error
\n
"
);
}
ok
(
readden
==
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
ReadFile
(
hnp
,
ibuf
+
4
,
sizeof
(
ibuf
)
-
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
ok
(
readden
==
sizeof
(
obuf
)
-
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
memcmp
(
obuf
,
ibuf
,
written
)
==
0
,
"content check
\n
"
);
/* Similar to above, but use a read buffer size small enough to read in three parts */
memset
(
ibuf
,
0
,
sizeof
(
ibuf
));
ok
(
WriteFile
(
hFile
,
obuf2
,
sizeof
(
obuf2
),
&
written
,
NULL
),
"WriteFile
\n
"
);
ok
(
written
==
sizeof
(
obuf2
),
"write file len
\n
"
);
if
(
pipemode
==
PIPE_TYPE_BYTE
)
{
ok
(
ReadFile
(
hnp
,
ibuf
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
ok
(
readden
==
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
ReadFile
(
hnp
,
ibuf
+
4
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
}
else
{
SetLastError
(
0xdeadbeef
);
todo_wine
ok
(
!
ReadFile
(
hnp
,
ibuf
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error
\n
"
);
ok
(
readden
==
4
,
"read got %d bytes
\n
"
,
readden
);
SetLastError
(
0xdeadbeef
);
todo_wine
ok
(
!
ReadFile
(
hnp
,
ibuf
+
4
,
4
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_MORE_DATA
,
"wrong error
\n
"
);
}
ok
(
readden
==
4
,
"read got %d bytes
\n
"
,
readden
);
ok
(
ReadFile
(
hnp
,
ibuf
+
8
,
sizeof
(
ibuf
)
-
8
,
&
readden
,
NULL
),
"ReadFile
\n
"
);
ok
(
readden
==
sizeof
(
obuf2
)
-
8
,
"read got %d bytes
\n
"
,
readden
);
ok
(
memcmp
(
obuf2
,
ibuf
,
written
)
==
0
,
"content check
\n
"
);
/* Test reading of multiple writes */
memset
(
ibuf
,
0
,
sizeof
(
ibuf
));
ok
(
WriteFile
(
hnp
,
obuf
,
sizeof
(
obuf
),
&
written
,
NULL
),
"WriteFile3a
\n
"
);
...
...
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