mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
test: process: Test Process::kill()
Add a test to ensure that Process::kill() on an unstarted process is safe. This aims at ensuring we don't kill other processes unexpectedly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
c8edfe29c1
commit
b52fcf9b0f
1 changed files with 4 additions and 0 deletions
|
@ -51,6 +51,10 @@ protected:
|
||||||
args.push_back(to_string(exitCode));
|
args.push_back(to_string(exitCode));
|
||||||
proc_.finished.connect(this, &ProcessTest::procFinished);
|
proc_.finished.connect(this, &ProcessTest::procFinished);
|
||||||
|
|
||||||
|
/* Test that kill() on an unstarted process is safe. */
|
||||||
|
proc_.kill();
|
||||||
|
|
||||||
|
/* Test starting the process and retrieving the exit code. */
|
||||||
int ret = proc_.start("/proc/self/exe", args);
|
int ret = proc_.start("/proc/self/exe", args);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
cerr << "failed to start process" << endl;
|
cerr << "failed to start process" << endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue