Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
cd7b71d3
Commit
cd7b71d3
authored
Mar 01, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added stdin close/open tests.
parent
db92137f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
file.c
dlls/msvcrt/tests/file.c
+37
-0
No files found.
dlls/msvcrt/tests/file.c
View file @
cd7b71d3
...
...
@@ -1964,6 +1964,42 @@ static void test_dup2(void)
ok
(
-
1
==
_dup2
(
0
,
-
1
),
"expected _dup2 to fail when second arg is negative
\n
"
);
}
static
void
test_stdin
(
void
)
{
HANDLE
stdinh
=
GetStdHandle
(
STD_INPUT_HANDLE
);
int
stdin_dup
,
fd
;
HANDLE
h
;
DWORD
r
;
stdin_dup
=
_dup
(
STDIN_FILENO
);
ok
(
stdin_dup
!=
-
1
,
"_dup(STDIN_FILENO) failed
\n
"
);
ok
(
stdinh
==
(
HANDLE
)
_get_osfhandle
(
STDIN_FILENO
),
"GetStdHandle(STD_INPUT_HANDLE) != _get_osfhandle(STDIN_FILENO)
\n
"
);
r
=
SetStdHandle
(
STD_INPUT_HANDLE
,
INVALID_HANDLE_VALUE
);
ok
(
r
==
TRUE
,
"SetStdHandle returned %x, expected TRUE
\n
"
,
r
);
h
=
GetStdHandle
(
STD_INPUT_HANDLE
);
ok
(
h
==
INVALID_HANDLE_VALUE
,
"h = %p
\n
"
,
h
);
close
(
STDIN_FILENO
);
h
=
GetStdHandle
(
STD_INPUT_HANDLE
);
ok
(
h
==
NULL
,
"h != NULL
\n
"
);
fd
=
open
(
"stdin.tst"
,
O_WRONLY
|
O_CREAT
,
_S_IREAD
|
_S_IWRITE
);
ok
(
fd
!=
-
1
,
"open failed
\n
"
);
ok
(
fd
==
STDIN_FILENO
,
"fd = %d, expected STDIN_FILENO
\n
"
,
fd
);
h
=
GetStdHandle
(
STD_INPUT_HANDLE
);
ok
(
h
!=
NULL
,
"h == NULL
\n
"
);
close
(
fd
);
unlink
(
"stdin.tst"
);
r
=
_dup2
(
stdin_dup
,
STDIN_FILENO
);
ok
(
r
!=
-
1
,
"_dup2 failed
\n
"
);
h
=
GetStdHandle
(
STD_INPUT_HANDLE
);
ok
(
h
!=
NULL
,
"h == NULL
\n
"
);
}
START_TEST
(
file
)
{
int
arg_c
;
...
...
@@ -2019,6 +2055,7 @@ START_TEST(file)
test_get_osfhandle
();
test_setmaxstdio
();
test_pipes
(
arg_v
[
0
]);
test_stdin
();
/* Wait for the (_P_NOWAIT) spawned processes to finish to make sure the report
* file contains lines in the correct order
...
...
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