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
62bd6154
Commit
62bd6154
authored
Jan 10, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added more read tests.
parent
f93259b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
file.c
dlls/msvcrt/tests/file.c
+28
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
62bd6154
...
...
@@ -956,6 +956,11 @@ static void test_file_write_read( void )
_lseek
(
tempfd
,
-
2
,
FILE_END
);
ret
=
_read
(
tempfd
,
btext
,
LLEN
);
ok
(
ret
==
1
&&
*
btext
==
'\n'
,
"_read expected '
\\
n' got bad length: %d
\n
"
,
ret
);
_lseek
(
tempfd
,
-
2
,
FILE_END
);
ret
=
_read
(
tempfd
,
btext
,
1
);
ok
(
ret
==
1
&&
*
btext
==
'\n'
,
"_read returned %d, buf: %d
\n
"
,
ret
,
*
btext
);
ret
=
read
(
tempfd
,
btext
,
1
);
ok
(
ret
==
0
,
"_read returned %d, expected 0
\n
"
,
ret
);
_lseek
(
tempfd
,
-
3
,
FILE_END
);
ret
=
_read
(
tempfd
,
btext
,
1
);
ok
(
ret
==
1
&&
*
btext
==
'e'
,
"_read expected 'e' got
\"
%.*s
\"
bad length: %d
\n
"
,
ret
,
btext
,
ret
);
...
...
@@ -1784,6 +1789,29 @@ static void test_pipes(const char* selfname)
i
=
fclose
(
file
);
ok
(
!
i
,
"unable to close the pipe: %d
\n
"
,
errno
);
if
(
_pipe
(
pipes
,
1024
,
O_BINARY
)
<
0
)
{
ok
(
0
,
"pipe failed with errno %d
\n
"
,
errno
);
return
;
}
r
=
write
(
pipes
[
1
],
"
\r\n\r
ab"
,
5
);
ok
(
r
==
5
,
"write returned %d, errno = %d
\n
"
,
r
,
errno
);
setmode
(
pipes
[
0
],
O_TEXT
);
r
=
read
(
pipes
[
0
],
buf
,
1
);
ok
(
r
==
1
,
"read returned %d, expected 1
\n
"
,
r
);
ok
(
buf
[
0
]
==
'\n'
,
"buf[0] = %x, expected '
\\
n'
\n
"
,
buf
[
0
]);
r
=
read
(
pipes
[
0
],
buf
,
1
);
ok
(
r
==
1
,
"read returned %d, expected 1
\n
"
,
r
);
ok
(
buf
[
0
]
==
'\r'
,
"buf[0] = %x, expected '
\\
r'
\n
"
,
buf
[
0
]);
r
=
read
(
pipes
[
0
],
buf
,
1
);
ok
(
r
==
1
,
"read returned %d, expected 1
\n
"
,
r
);
ok
(
buf
[
0
]
==
'a'
,
"buf[0] = %x, expected 'a'
\n
"
,
buf
[
0
]);
r
=
read
(
pipes
[
0
],
buf
,
1
);
ok
(
r
==
1
,
"read returned %d, expected 1
\n
"
,
r
);
ok
(
buf
[
0
]
==
'b'
,
"buf[0] = %x, expected 'b'
\n
"
,
buf
[
0
]);
close
(
pipes
[
1
]);
close
(
pipes
[
0
]);
}
static
void
test_unlink
(
void
)
...
...
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