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
0d0f7050
Commit
0d0f7050
authored
Jan 18, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added basic _popen tests.
parent
a968a1ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
misc.c
dlls/msvcrt/tests/misc.c
+46
-0
No files found.
dlls/msvcrt/tests/misc.c
View file @
0d0f7050
...
...
@@ -20,6 +20,7 @@
#include "wine/test.h"
#include <errno.h>
#include <stdio.h>
#include "msvcrt.h"
static
int
(
__cdecl
*
prand_s
)(
unsigned
int
*
);
...
...
@@ -309,10 +310,54 @@ static void test__set_errno(void)
ok
(
errno
==
0xdeadbeef
,
"Expected errno to be 0xdeadbeef, got %d
\n
"
,
errno
);
}
static
void
test__popen_child
(
void
)
{
/* don't execute any tests here */
/* ExitProcess is used to set return code of _pclose */
printf
(
"child output
\n
"
);
ExitProcess
(
0x37
);
}
static
void
test__popen
(
const
char
*
name
)
{
FILE
*
pipe
;
char
buf
[
1024
];
int
ret
;
sprintf
(
buf
,
"%s misc popen"
,
name
);
pipe
=
_popen
(
buf
,
"r"
);
ok
(
pipe
!=
NULL
,
"_popen failed with error: %d
\n
"
,
errno
);
fgets
(
buf
,
sizeof
(
buf
),
pipe
);
ok
(
!
strcmp
(
buf
,
"child output
\n
"
),
"buf = %s
\n
"
,
buf
);
ret
=
_pclose
(
pipe
);
ok
(
ret
==
0x37
,
"_pclose returned %x, expected 0x37
\n
"
,
ret
);
errno
=
0xdeadbeef
;
ret
=
_pclose
((
FILE
*
)
0xdeadbeef
);
ok
(
ret
==
-
1
,
"_pclose returned %x, expected -1
\n
"
,
ret
);
if
(
p_set_errno
)
ok
(
errno
==
EBADF
,
"errno = %d
\n
"
,
errno
);
}
START_TEST
(
misc
)
{
int
arg_c
;
char
**
arg_v
;
init
();
arg_c
=
winetest_get_mainargs
(
&
arg_v
);
if
(
arg_c
>=
3
)
{
if
(
!
strcmp
(
arg_v
[
2
],
"popen"
))
test__popen_child
();
else
ok
(
0
,
"invalid argument '%s'
\n
"
,
arg_v
[
2
]);
return
;
}
test_rand_s
();
test_I10_OUTPUT
();
test_strerror_s
();
...
...
@@ -320,4 +365,5 @@ START_TEST(misc)
test__get_errno
();
test__set_doserrno
();
test__set_errno
();
test__popen
(
arg_v
[
0
]);
}
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