diff options
Diffstat (limited to 'src/zenserver-test/process-tests.cpp')
| -rw-r--r-- | src/zenserver-test/process-tests.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/zenserver-test/process-tests.cpp b/src/zenserver-test/process-tests.cpp index 649f24f54..ae11bb294 100644 --- a/src/zenserver-test/process-tests.cpp +++ b/src/zenserver-test/process-tests.cpp @@ -67,10 +67,7 @@ TEST_CASE("pipe.capture_stdout") CreateProcOptions Options; Options.StdoutPipe = &Pipe; - CreateProcResult ProcResult = CreateProc(AppStub, CommandLine, Options); - - ProcessHandle Process; - Process.Initialize(ProcResult); + ProcessHandle Process(CreateProc(AppStub, CommandLine, Options)); // Close the write end, then drain before Wait() to avoid deadlock if output fills the pipe buffer. Pipe.CloseWriteEnd(); @@ -95,10 +92,7 @@ TEST_CASE("pipe.capture_multiline") CreateProcOptions Options; Options.StdoutPipe = &Pipe; - CreateProcResult ProcResult = CreateProc(AppStub, CommandLine, Options); - - ProcessHandle Process; - Process.Initialize(ProcResult); + ProcessHandle Process(CreateProc(AppStub, CommandLine, Options)); Pipe.CloseWriteEnd(); @@ -211,10 +205,7 @@ TEST_CASE("pipe.capture_with_nonzero_exit") CreateProcOptions Options; Options.StdoutPipe = &Pipe; - CreateProcResult ProcResult = CreateProc(AppStub, CommandLine, Options); - - ProcessHandle Process; - Process.Initialize(ProcResult); + ProcessHandle Process(CreateProc(AppStub, CommandLine, Options)); Pipe.CloseWriteEnd(); @@ -237,10 +228,7 @@ TEST_CASE("pipe.stderr_on_shared_pipe") CreateProcOptions Options; Options.StdoutPipe = &Pipe; - CreateProcResult ProcResult = CreateProc(AppStub, CommandLine, Options); - - ProcessHandle Process; - Process.Initialize(ProcResult); + ProcessHandle Process(CreateProc(AppStub, CommandLine, Options)); Pipe.CloseWriteEnd(); @@ -268,10 +256,7 @@ TEST_CASE("pipe.separate_stderr") Options.StdoutPipe = &StdoutPipe; Options.StderrPipe = &StderrPipe; - CreateProcResult ProcResult = CreateProc(AppStub, CommandLine, Options); - - ProcessHandle Process; - Process.Initialize(ProcResult); + ProcessHandle Process(CreateProc(AppStub, CommandLine, Options)); StdoutPipe.CloseWriteEnd(); StderrPipe.CloseWriteEnd(); |