diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-27 01:49:08 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-27 22:30:07 +0300 |
commit | b52fcf9b0f745fe0309c988fa550344378e3cfa0 (patch) | |
tree | 6851bf8259111ad09a78caa6801c38dd9fd1faac | |
parent | c8edfe29c185dade3aa584363d91643755fe7e02 (diff) |
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>
-rw-r--r-- | test/process/process_test.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp index ce0cc7c9..721a7c9d 100644 --- a/test/process/process_test.cpp +++ b/test/process/process_test.cpp @@ -51,6 +51,10 @@ protected: args.push_back(to_string(exitCode)); 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); if (ret) { cerr << "failed to start process" << endl; |