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
30504fbd
Commit
30504fbd
authored
Jun 26, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Jun 26, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a small test for process exit code retrieval.
parent
5552da92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
process.c
dlls/kernel/tests/process.c
+37
-0
No files found.
dlls/kernel/tests/process.c
View file @
30504fbd
...
@@ -347,6 +347,13 @@ static void doChild(const char* file, const char* option)
...
@@ -347,6 +347,13 @@ static void doChild(const char* file, const char* option)
}
}
}
}
if
(
option
&&
strcmp
(
option
,
"exit_code"
)
==
0
)
{
childPrintf
(
hFile
,
"[ExitCode]
\n
value=%d
\n\n
"
,
123
);
CloseHandle
(
hFile
);
ExitProcess
(
123
);
}
CloseHandle
(
hFile
);
CloseHandle
(
hFile
);
}
}
...
@@ -1135,6 +1142,35 @@ static void test_Console(void)
...
@@ -1135,6 +1142,35 @@ static void test_Console(void)
assert
(
DeleteFileA
(
resfile
)
!=
0
);
assert
(
DeleteFileA
(
resfile
)
!=
0
);
}
}
static
void
test_ExitCode
(
void
)
{
char
buffer
[
MAX_PATH
];
PROCESS_INFORMATION
info
;
STARTUPINFOA
startup
;
DWORD
code
;
/* let's start simplistic */
memset
(
&
startup
,
0
,
sizeof
(
startup
));
startup
.
cb
=
sizeof
(
startup
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
;
startup
.
wShowWindow
=
SW_SHOWNORMAL
;
get_file_name
(
resfile
);
sprintf
(
buffer
,
"%s tests/process.c %s exit_code"
,
selfname
,
resfile
);
ok
(
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
),
"CreateProcess"
);
/* wait for child to terminate */
ok
(
WaitForSingleObject
(
info
.
hProcess
,
30000
)
==
WAIT_OBJECT_0
,
"Child process termination"
);
/* child process has changed result file, so let profile functions know about it */
WritePrivateProfileStringA
(
NULL
,
NULL
,
NULL
,
resfile
);
ok
(
GetExitCodeProcess
(
info
.
hProcess
,
&
code
),
"Getting exit code"
);
okChildInt
(
"ExitCode"
,
"value"
,
code
);
release_memory
();
assert
(
DeleteFileA
(
resfile
)
!=
0
);
}
START_TEST
(
process
)
START_TEST
(
process
)
{
{
int
b
=
init
();
int
b
=
init
();
...
@@ -1153,6 +1189,7 @@ START_TEST(process)
...
@@ -1153,6 +1189,7 @@ START_TEST(process)
test_SuspendFlag
();
test_SuspendFlag
();
test_DebuggingFlag
();
test_DebuggingFlag
();
test_Console
();
test_Console
();
test_ExitCode
();
/* things that can be tested:
/* things that can be tested:
* lookup: check the way program to be executed is searched
* lookup: check the way program to be executed is searched
* handles: check the handle inheritance stuff (+sec options)
* handles: check the handle inheritance stuff (+sec options)
...
...
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