00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PSTEST_H
00016 #define PSTEST_H
00017
00018 #include <stdio.h>
00019
00020 #include "psType.h"
00021
00022 #define printPositiveTestHeader(filePtr, packageName, testPointName) \
00023 p_printPositiveTestHeader(filePtr, __FILE__, packageName, testPointName)
00024
00025 #define printNegativeTestHeader(filePtr, packageName, testPointName, expectedError, exitValue) \
00026 p_printNegativeTestHeader(filePtr, __FILE__, packageName, testPointName, expectedError, exitValue)
00027
00028 #define printFooter(filePtr, packageName, testPointName, success) \
00029 p_printFooter(filePtr, __FILE__, packageName, testPointName, success)
00030
00031
00032 typedef psS32 (*testFcn)(void);
00033
00034
00035 typedef struct
00036 {
00037 testFcn fcn;
00038 psS32 testPointNumber;
00039 const char* testPointName;
00040 psS32 expectedReturn;
00041 psBool isDuplicateEntry;
00042 }
00043 testDescription;
00044
00045 #define runTest(filePtr, packageName, testPointName, fcn, expectedReturn, useFork) \
00046 p_runTest(filePtr, __FILE__, packageName, testPointName, fcn, expectedReturn, useFork)
00047
00048 #define runTestSuite(filePtr, packageName, tests, argc, argv) \
00049 p_runTestSuite(filePtr, __FILE__, packageName, tests, argc, argv)
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 psBool p_runTest(
00061 FILE *fp,
00062 const char* testPointFile,
00063 const char* packageName,
00064 const char* testPointName,
00065 testFcn fcn,
00066 psS32 expectedReturn,
00067 psBool useFork
00068 );
00069
00070
00071
00072
00073
00074 psBool p_runTestSuite(
00075 FILE *fp,
00076 const char* testPointFile,
00077 const char* packageName,
00078 testDescription tests[],
00079 psS32 argc,
00080 char * const argv[]
00081 );
00082
00083
00084 void p_printPositiveTestHeader(
00085 FILE *fp,
00086 const char* testPointFile,
00087 const char* packageName,
00088 const char* testPointName
00089 );
00090
00091
00092 void p_printNegativeTestHeader(
00093 FILE *fp,
00094 const char* testPointFile,
00095 const char* packageName,
00096 const char* testPointName,
00097 const char* expectedError,
00098 psS32 exitValue
00099 );
00100
00101
00102 void p_printFooter(
00103 FILE *fp,
00104 const char* testPointFile,
00105 const char* packageName,
00106 const char* testPointName,
00107 psBool success
00108 );
00109
00110 #endif // #ifndef PSTEST_H