During a test, C++test will create test cases based on the criteria defined in the selected Test Configuration’s Generation tab.
The Generation tab has the following settings:
Redirect stdin/stdout/stderr streams: Determines if C++test automatically inserts streams redirection code to auto-generated test cases (you can add some data to stdin and/or check stdout/err as post-conditions). The test case code will look something like:
...
CppTest_StreamRedirect* _stdinStreamRedirect =
CppTest_RedirectStdInput("some value");
CppTest_StreamRedirect* _stdoutStreamRedirect =
CppTest_RedirectStdOutput();
CppTest_StreamRedirect* _stderrStreamRedirect =
CppTest_RedirectStdError();
...
/* Tested function call */
...
/* Post-condition check */
...
CPPTEST_POST_CONDITION_CSTR_N("stdout", (CppTest_StreamReadData(_stdoutStreamRedirect, 0) ), 256)
CPPTEST_POST_CONDITION_CSTR_N("stderr", (CppTest_StreamReadData(_stderrStreamRedirect, 0) ), 256) |