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
d6900fc5
Commit
d6900fc5
authored
Sep 18, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add 0-length read tests for a disk file.
parent
6e143e6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
file.c
dlls/ntdll/tests/file.c
+41
-0
No files found.
dlls/ntdll/tests/file.c
View file @
d6900fc5
...
...
@@ -1985,6 +1985,22 @@ static void test_read_write(void)
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buf
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hfile
,
buf
,
0
,
&
bytes
,
NULL
);
ok
(
ret
,
"ReadFile error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hfile
,
buf
,
sizeof
(
buf
),
&
bytes
,
NULL
);
ok
(
ret
,
"ReadFile error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %d
\n
"
,
GetLastError
());
...
...
@@ -2184,6 +2200,31 @@ todo_wine
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
INVALID_HANDLE_VALUE
,
buf
,
0
,
&
bytes
,
NULL
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"expected ERROR_INVALID_HANDLE, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
S
(
U
(
ovl
)).
Offset
=
0
;
S
(
U
(
ovl
)).
OffsetHigh
=
0
;
ovl
.
Internal
=
-
1
;
ovl
.
InternalHigh
=
-
1
;
ovl
.
hEvent
=
0
;
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hfile
,
buf
,
0
,
&
bytes
,
&
ovl
);
/* ReadFile return value depends on Windows version and testing it is not practical */
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_IO_PENDING
,
"expected ERROR_IO_PENDING, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_SUCCESS
,
"expected STATUS_SUCCESS, got %#lx
\n
"
,
ovl
.
Internal
);
todo_wine
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
bytes
=
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
ret
=
WriteFile
(
hfile
,
contents
,
sizeof
(
contents
),
&
bytes
,
NULL
);
ok
(
!
ret
,
"WriteFile should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
...
...
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