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 typedef psS32 (*testFcn)(void);
00032
00033 typedef struct
00034 {
00035 testFcn fcn;
00036 psS32 testPointNumber;
00037 const char* testPointName;
00038 psS32 expectedReturn;
00039 psBool isDuplicateEntry;
00040 }
00041 testDescription;
00042
00043 #define runTest(filePtr, packageName, testPointName, fcn, expectedReturn, useFork) \
00044 p_runTest(filePtr, __FILE__, packageName, testPointName, fcn, expectedReturn, useFork)
00045
00046 #define runTestSuite(filePtr, packageName, tests, argc, argv) \
00047 p_runTestSuite(filePtr, __FILE__, packageName, tests, argc, argv)
00048
00049
00050
00051
00052 psBool p_runTest(
00053 FILE *fp,
00054 const char* testPointFile,
00055 const char* packageName,
00056 const char* testPointName,
00057 testFcn fcn,
00058 psS32 expectedReturn,
00059 psBool useFork
00060 );
00061
00062 psBool p_runTestSuite(
00063 FILE *fp,
00064 const char* testPointFile,
00065 const char* packageName,
00066 testDescription tests[],
00067 psS32 argc,
00068 char * const argv[]
00069 );
00070
00071 void p_printPositiveTestHeader(
00072 FILE *fp,
00073 const char* testPointFile,
00074 const char* packageName,
00075 const char* testPointName
00076 );
00077
00078 void p_printNegativeTestHeader(
00079 FILE *fp,
00080 const char* testPointFile,
00081 const char* packageName,
00082 const char* testPointName,
00083 const char* expectedError,
00084 psS32 exitValue
00085 );
00086
00087 void p_printFooter(
00088 FILE *fp,
00089 const char* testPointFile,
00090 const char* packageName,
00091 const char* testPointName,
00092 psBool success
00093 );
00094
00095 #endif // #ifndef PSTEST_H