IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 526


Ignore:
Timestamp:
Apr 26, 2004, 4:20:28 PM (22 years ago)
Author:
evanalst
Message:

Modified psTest to specify file pointer to send output.

Location:
trunk/psLib/test
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/psTest.c

    r509 r526  
    1818#define HEADER_BOTTOM "\\------------------------------------------------------------------------/\n\n"
    1919
    20 void p_printPositiveTestHeader(const char* testPointFile, const char* packageName, const char* testPointName)
     20void p_printPositiveTestHeader(FILE *fp, const char* testPointFile, const char* packageName, const char* testPointName)
    2121{
    2222    char TP[80];
     
    2424    snprintf(TP,80,"%s{%s}",packageName,testPointName);
    2525
    26     printf(HEADER_TOP);
    27     printf(HEADER_LINE_STRING, "TestFile", testPointFile);
    28     printf(HEADER_LINE_STRING, "TestPoint", TP);
    29     printf(HEADER_LINE_STRING, "TestType","Positive");
    30     printf(HEADER_BOTTOM);
     26    fprintf(fp, HEADER_TOP);
     27    fprintf(fp, HEADER_LINE_STRING, "TestFile", testPointFile);
     28    fprintf(fp, HEADER_LINE_STRING, "TestPoint", TP);
     29    fprintf(fp, HEADER_LINE_STRING, "TestType","Positive");
     30    fprintf(fp, HEADER_BOTTOM);
    3131}
    3232
    33 void p_printNegativeTestHeader(const char* testPointFile, const char* packageName,
     33void p_printNegativeTestHeader(FILE *fp, const char* testPointFile, const char* packageName,
    3434                               const char* testPointName,const char* expectedError, int exitValue)
    3535{
     
    3838    snprintf(TP,80,"%s{%s}",packageName,testPointName);
    3939
    40     printf(HEADER_TOP);
    41     printf(HEADER_LINE_STRING, "TestFile", testPointFile);
    42     printf(HEADER_LINE_STRING, "TestPoint", TP);
    43     printf(HEADER_LINE_STRING,"TestType","Negative");
    44     printf(HEADER_LINE_STRING,"ExpectedErrorText",expectedError);
    45     printf(HEADER_LINE_INT,"ExpectedStatusValue",exitValue);
    46     printf(HEADER_BOTTOM);
     40    fprintf(fp, HEADER_TOP);
     41    fprintf(fp, HEADER_LINE_STRING, "TestFile", testPointFile);
     42    fprintf(fp, HEADER_LINE_STRING, "TestPoint", TP);
     43    fprintf(fp, HEADER_LINE_STRING,"TestType","Negative");
     44    fprintf(fp, HEADER_LINE_STRING,"ExpectedErrorText",expectedError);
     45    fprintf(fp, HEADER_LINE_INT,"ExpectedStatusValue",exitValue);
     46    fprintf(fp, HEADER_BOTTOM);
    4747}
    4848
    4949
    50 void p_printFooter(const char* testPointFile, const char* packageName,const char* testPointName, bool success)
     50void p_printFooter(FILE *fp, const char* testPointFile, const char* packageName,const char* testPointName, bool success)
    5151{
    5252    if (success) {
    53         printf("\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName,testPointName, testPointFile);
     53        fprintf(fp, "\n---> TESTPOINT PASSED (%s{%s} | %s)\n\n", packageName,testPointName, testPointFile);
    5454    } else {
    55         printf("\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName,testPointName,testPointFile);
     55        fprintf(fp, "\n---> TESTPOINT FAILED (%s{%s} | %s)\n\n", packageName,testPointName,testPointFile);
    5656    }
    5757}
  • trunk/psLib/test/psTest.h

    r509 r526  
    66#include <stdbool.h>
    77
    8 #define printPositiveTestHeader(packageName, testPointName) \
    9 p_printPositiveTestHeader(__FILE__, packageName, testPointName)
     8#define printPositiveTestHeader(filePtr, packageName, testPointName) \
     9p_printPositiveTestHeader(filePtr, __FILE__, packageName, testPointName)
    1010
    11 #define printNegativeTestHeader(packageName, testPointName, expectedError, exitValue) \
    12 p_printNegativeTestHeader(__FILE__, packageName, testPointName, expectedError, exitValue)
     11#define printNegativeTestHeader(filePtr, packageName, testPointName, expectedError, exitValue) \
     12p_printNegativeTestHeader(filePtr, __FILE__, packageName, testPointName, expectedError, exitValue)
    1313
    14 #define printFooter(packageName, testPointName, success) \
    15 p_printFooter(__FILE__, packageName, testPointName, success)
     14#define printFooter(filePtr, packageName, testPointName, success) \
     15p_printFooter(filePtr, __FILE__, packageName, testPointName, success)
    1616
    1717
    1818/////////////////////////// PRIVATE FUNCTIONS //////////////////////////////
    1919
    20 void p_printPositiveTestHeader(const char* testPointFile, const char* packageName, const char* testPointName);
     20void p_printPositiveTestHeader(FILE *fp, const char* testPointFile, const char* packageName, const char* testPointName);
    2121
    22 void p_printNegativeTestHeader(const char* testPointFile, const char* packageName,
     22void p_printNegativeTestHeader(FILE *fp, const char* testPointFile, const char* packageName,
    2323                               const char* testPointName,const char* expectedError, int exitValue);
    2424
    25 void p_printFooter(const char* testPointFile, const char* packageName, const char* testPointName, bool
     25void p_printFooter(FILE *fp, const char* testPointFile, const char* packageName, const char* testPointName, bool
    2626                   success);
    2727#endif
Note: See TracChangeset for help on using the changeset viewer.