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
fa2ca8f6
Commit
fa2ca8f6
authored
Oct 11, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add more tests for reading beyond EOF.
parent
2f26e385
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
18 deletions
+48
-18
file.c
dlls/ntdll/tests/file.c
+48
-18
No files found.
dlls/ntdll/tests/file.c
View file @
fa2ca8f6
...
...
@@ -2123,6 +2123,31 @@ todo_wine
off
=
SetFilePointer
(
hfile
,
0
,
NULL
,
FILE_CURRENT
);
ok
(
off
==
sizeof
(
contents
),
"expected sizeof(contents), got %u
\n
"
,
off
);
/* test reading beyond EOF */
bytes
=
-
1
;
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
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
S
(
U
(
ovl
)).
Offset
=
sizeof
(
contents
);
S
(
U
(
ovl
)).
OffsetHigh
=
0
;
ovl
.
Internal
=
-
1
;
ovl
.
InternalHigh
=
-
1
;
ovl
.
hEvent
=
0
;
bytes
=
-
1
;
SetLastError
(
0xdeadbeef
);
ret
=
ReadFile
(
hfile
,
buf
,
sizeof
(
buf
),
&
bytes
,
&
ovl
);
todo_wine
ok
(
!
ret
,
"ReadFile should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_HANDLE_EOF
,
"expected ERROR_HANDLE_EOF, got %d
\n
"
,
GetLastError
());
ok
(
bytes
==
0
,
"bytes %u
\n
"
,
bytes
);
todo_wine
ok
((
NTSTATUS
)
ovl
.
Internal
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#lx
\n
"
,
ovl
.
Internal
);
ok
(
ovl
.
InternalHigh
==
0
,
"expected 0, got %lu
\n
"
,
ovl
.
InternalHigh
);
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
...
...
@@ -2132,18 +2157,15 @@ todo_wine
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
for
(
i
=
-
20
;
i
<
0
;
i
++
)
{
if
(
i
==
-
2
)
continue
;
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
offset
.
QuadPart
=
(
LONGLONG
)
i
;
offset
.
QuadPart
=
sizeof
(
contents
)
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
&
offset
,
NULL
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"%d: expected STATUS_INVALID_PARAMETER, got %#x
\n
"
,
i
,
status
);
ok
(
iob
.
Status
==
-
1
,
"expected -1, got %#x
\n
"
,
iob
.
Status
);
ok
(
iob
.
Information
==
-
1
,
"expected -1, got %ld
\n
"
,
iob
.
Information
);
}
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
iob
.
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
iob
.
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
...
...
@@ -2155,6 +2177,19 @@ todo_wine
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
for
(
i
=
-
20
;
i
<
0
;
i
++
)
{
if
(
i
==
-
2
)
continue
;
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
offset
.
QuadPart
=
(
LONGLONG
)
i
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
&
offset
,
NULL
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"%d: expected STATUS_INVALID_PARAMETER, got %#x
\n
"
,
i
,
status
);
ok
(
iob
.
Status
==
-
1
,
"expected -1, got %#x
\n
"
,
iob
.
Status
);
ok
(
iob
.
Information
==
-
1
,
"expected -1, got %ld
\n
"
,
iob
.
Information
);
}
SetFilePointer
(
hfile
,
0
,
NULL
,
FILE_BEGIN
);
bytes
=
0
;
...
...
@@ -2169,15 +2204,6 @@ todo_wine
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
ok
(
status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
status
);
todo_wine
ok
(
iob
.
Status
==
STATUS_END_OF_FILE
,
"expected STATUS_END_OF_FILE, got %#x
\n
"
,
iob
.
Status
);
todo_wine
ok
(
iob
.
Information
==
0
,
"expected 0, got %lu
\n
"
,
iob
.
Information
);
iob
.
Status
=
-
1
;
iob
.
Information
=
-
1
;
offset
.
QuadPart
=
0
;
status
=
pNtReadFile
(
hfile
,
0
,
NULL
,
NULL
,
&
iob
,
buf
,
sizeof
(
buf
),
&
offset
,
NULL
);
ok
(
status
==
STATUS_SUCCESS
,
"NtReadFile error %#x
\n
"
,
status
);
...
...
@@ -2333,6 +2359,10 @@ todo_wine
ok
(
iob
.
Information
==
-
1
,
"expected -1, got %ld
\n
"
,
iob
.
Information
);
}
off
=
SetFilePointer
(
hfile
,
0
,
NULL
,
FILE_CURRENT
);
ok
(
off
==
0
,
"expected 0, got %u
\n
"
,
off
);
/* test reading beyond EOF */
offset
.
QuadPart
=
sizeof
(
contents
);
S
(
U
(
ovl
)).
Offset
=
offset
.
u
.
LowPart
;
S
(
U
(
ovl
)).
OffsetHigh
=
offset
.
u
.
HighPart
;
...
...
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