* which represents the context of a test case during his
* execution.
*/
-typedef struct s_TestCaseContext
-{
- char* name; /* the test case name */
- int timeoutValue; /* the timeout value */
- bool isOutputCheckingEnabled; /* if true, output checking is enable */
- bool isPostOutputCheckingEnabled; /* if true, the post output checking mode is enable */
- Buffer_t inputBuffer; /* buffer that contains child input */
- Buffer_t outputBuffer; /* the child output buffer */
- Buffer_t expectedOutputBuffer; /* buffer that contains child expected output */
- int expectedExitCode; /* the child expected exit code */
- int threadExitCode; /* the thread exit code */
- int exitCode; /* the child process exit code */
- bool runThread; /* false if the thread of the test case must terminate */
- HANDLE hThread; /* the handle of the thread */
- HANDLE hOutputRead; /* handle to the read pipe */
- HANDLE hInputWrite; /* handle to the write pipe */
- HANDLE hChildStdInRead; /* handle to the pipe used to read the child std input */
- HANDLE hChildStdOutWrite; /* handle to the pipe used to write to the chil std output */
- HANDLE hChildStderr; /* handle to the pipe used to read the child std error */
- PROCESS_INFORMATION pi; /* this structure contains child process informations */
- HANDLE hChildStdoutReadTmp; /* tempory handle */
- HANDLE hChildStdinWriteTmp; /* tempory handle */
- bool createConsole; /* true if we can create a console for the child process */
- bool exitCodeCheckingEnabled; /* true if we want to check the child exit code */
- HANDLE hConsole; /* handle to the console */
- bool started; /* true if the child process started */
- Buffer_t commandLineBuffer; /* command line buffer */
-
-}s_TestCaseContext_t,* TestCaseContext_t;
+typedef struct s_TestCaseContext {
+ char *name; /* the test case name */
+ int timeoutValue; /* the timeout value */
+ bool isOutputCheckingEnabled; /* if true, output checking is enable */
+ bool isPostOutputCheckingEnabled; /* if true, the post output checking mode is enable */
+ Buffer_t inputBuffer; /* buffer that contains child input */
+ Buffer_t outputBuffer; /* the child output buffer */
+ Buffer_t expectedOutputBuffer; /* buffer that contains child expected output */
+ int expectedExitCode; /* the child expected exit code */
+ int threadExitCode; /* the thread exit code */
+ int exitCode; /* the child process exit code */
+ bool runThread; /* false if the thread of the test case must terminate */
+ HANDLE hThread; /* the handle of the thread */
+ HANDLE hOutputRead; /* handle to the read pipe */
+ HANDLE hInputWrite; /* handle to the write pipe */
+ HANDLE hChildStdInRead; /* handle to the pipe used to read the child std input */
+ HANDLE hChildStdOutWrite; /* handle to the pipe used to write to the chil std output */
+ HANDLE hChildStderr; /* handle to the pipe used to read the child std error */
+ PROCESS_INFORMATION pi; /* this structure contains child process informations */
+ HANDLE hChildStdoutReadTmp; /* tempory handle */
+ HANDLE hChildStdinWriteTmp; /* tempory handle */
+ bool createConsole; /* true if we can create a console for the child process */
+ bool exitCodeCheckingEnabled; /* true if we want to check the child exit code */
+ HANDLE hConsole; /* handle to the console */
+ bool started; /* true if the child process started */
+ Buffer_t commandLineBuffer; /* command line buffer */
+
+} s_TestCaseContext_t, *TestCaseContext_t;
/* Output checking is disabled by default*/
#define DEFAULT_OUTPUT_CHECKING_MODE false
#define DEFAULT_POST_OUTPUT_CHECKING_MODE false
/* The default timeout value is 5 seconds*/
- #define DEFAULT_TIMEOUT_VALUE ((int)120000)
-
+#define DEFAULT_TIMEOUT_VALUE ((int)120000)
+
/* Invalid exit code value (default value)*/
#define INVALID_EXIT_CODE ((int)0xFFFFFF)
/*
* Set the timeout of the test case context.
*/
-void TestCaseContext_setTimeout(TestCaseContext_t context,int timeout);
+void TestCaseContext_setTimeout(TestCaseContext_t context, int timeout);
/*
* Enable the output checking of the test case context.
/*
* Enable the post output checking of the test case context.
*/
-void TestCaseContext_enable_post_output_checking(TestCaseContext_t context);
+void TestCaseContext_enable_post_output_checking(TestCaseContext_t
+ context);
/*
* Disable the post output checking of the test case context.
/*
* Set the expected exit code of the test case context.
*/
-void TestCaseContext_setExpectedExitCode(TestCaseContext_t context,int expected_code);
+void TestCaseContext_setExpectedExitCode(TestCaseContext_t context,
+ int expected_code);
/*
* Return true if the output checking mode is enabled for this
* Append a child output to check in the
* test case context.
*/
-void TestCaseContext_appendExpectedOutput(TestCaseContext_t context,char* expected_output);
+void TestCaseContext_appendExpectedOutput(TestCaseContext_t context,
+ char *expected_output);
/*
* Append a child output to check in the
* test case context.
*/
-void TestCaseContext_appendChildInput(TestCaseContext_t context,char* input);
+void TestCaseContext_appendChildInput(TestCaseContext_t context,
+ char *input);
/*
* Set the name of the test case name.
*/
-void TestCaseContext_setName(TestCaseContext_t context,char* name);
+void TestCaseContext_setName(TestCaseContext_t context, char *name);
void TestCaseContext_createConsole(TestCaseContext_t context);
void TestCaseContext_disableExitCodeChecking(TestCaseContext_t context);
-void TestCaseContext_setCommandLine(TestCaseContext_t context,char* cmdLine);
+void TestCaseContext_setCommandLine(TestCaseContext_t context,
+ char *cmdLine);
+
-
-#endif /* #ifndef __TestCaseContext_H__ */
\ No newline at end of file
+#endif /* #ifndef __TestCaseContext_H__ */