aboutsummaryrefslogtreecommitdiff
path: root/tests/process/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/process/driver.cxx')
-rw-r--r--tests/process/driver.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/process/driver.cxx b/tests/process/driver.cxx
index 0aa9177..d59b1a7 100644
--- a/tests/process/driver.cxx
+++ b/tests/process/driver.cxx
@@ -255,6 +255,26 @@ main (int argc, const char* argv[])
return 0;
}
+ // Test processes created as "already terminated".
+ //
+ {
+ process p;
+ assert (!p.wait ()); // "Terminated" abnormally.
+ }
+
+ {
+ // Note that if to create as just process(0) then the
+ // process(const char* args[], int=0, int=1, int=2) ctor is being called.
+ //
+ process p (optional<process::status_type> (0));
+ assert (p.wait ()); // "Exited" successfully.
+ }
+
+ {
+ process p (optional<process::status_type> (1));
+ assert (!p.wait ()); // "Exited" with an error.
+ }
+
const char* s ("ABC\nXYZ");
assert (exec (p));