@@ -53,15 +53,19 @@ void SC::AsyncTest::processExit()
53
53
SC_TEST_EXPECT (outParams2.exitStatus != 0 ); // Status == Not OK
54
54
}
55
55
56
- void SC::AsyncTest::processInputOutput ()
56
+ void SC::AsyncTest::processInputOutput (bool useThreadPool )
57
57
{
58
58
StringSpan params[] = {report.executableFile , " --quiet" , " --test" ,
59
59
" AsyncTest" , " --test-section" , " process input output child" };
60
-
60
+ ThreadPool threadPool;
61
+ if (useThreadPool)
62
+ {
63
+ SC_TEST_EXPECT (threadPool.create (1 ));
64
+ }
61
65
PipeDescriptor processStdOut;
62
66
PipeOptions pipeOptions;
63
67
64
- pipeOptions.blocking = true ;
68
+ pipeOptions.blocking = useThreadPool ;
65
69
pipeOptions.writeInheritable = true ;
66
70
SC_TEST_EXPECT (processStdOut.createPipe (pipeOptions));
67
71
AsyncEventLoop eventLoop;
@@ -84,8 +88,14 @@ void SC::AsyncTest::processInputOutput()
84
88
}
85
89
};
86
90
AsyncTaskSequence asyncReadTask;
87
- SC_TEST_EXPECT (eventLoop.associateExternallyCreatedFileDescriptor (processStdOut.readPipe ));
88
-
91
+ if (useThreadPool)
92
+ {
93
+ SC_TEST_EXPECT (asyncRead.executeOn (asyncReadTask, threadPool));
94
+ }
95
+ else
96
+ {
97
+ SC_TEST_EXPECT (eventLoop.associateExternallyCreatedFileDescriptor (processStdOut.readPipe ));
98
+ }
89
99
SC_TEST_EXPECT (processStdOut.readPipe .get (asyncRead.handle , Result::Error (" handle" )));
90
100
char myBuffer[4 ]; // just enough to hold "asdf";
91
101
asyncRead.buffer = myBuffer;
0 commit comments