Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

TestUtilities.h File Reference


Detailed Description

Utility functions to write various types of messages and headers to an output device.

Depending on the value of the #define constant MS_HOST, the output device is either the file 'out' or the standard output. Messages to the file 'out' are written in HTML. Messages to the standard output are written as plain text.

Definition in file TestUtilities.h.

Go to the source code of this file.

Functions

void printRegressionTestHeader (FILE *outFile)
 Print the header of the regression test report.

void printRegressionTestTail (FILE *outFile)
 Print the close out of the regression test report.

void printTestSuccess (FILE *outFile, char *testName, char *testMsg)
 Print a message describing the outcome of a test case to an output file.

void printTestFailed (FILE *outFile, char *testName, char *testMsg)
 Print a message describing the outcome of a test case to an output file.

void printErrorMsg (FILE *outFile, char *testName, char *msg)
 Print a message describing an error that occurred during set up or shut down of a test case to an output file.

char * doubleUnderscore (FILE *outFile, char *testName)
 Double any underscore characters in the input string.


Function Documentation

char* doubleUnderscore FILE *  outFile,
char *  testName
 

Double any underscore characters in the input string.

The input string is transformed into the output string as follows:<ul> if the input string does not contain any underscore character ('_'), it is left unchanged if the input string contains one or more underscore character ('_'), the output string replaces them with two underscore characters (for instance, string "aaa_bb" is transformed into: "aaa__bb"). This function is useful because Doxygen double underscores when creating the name of the file to hold the description of a class.

This function assumes that the length of the output string is less than MAX_TEST_FILE_NAME_LENGTH.

Parameters:
outFile the file to which the regression test output is written
testName the name of the test case
See also:
MAX_TEST_FILE_NAME_LENGTH

Definition at line 87 of file TestUtilities.cpp.

void printErrorMsg FILE *  outFile,
char *  testName,
char *  msg
 

Print a message describing an error that occurred during set up or shut down of a test case to an output file.

This function should only be called if function printRegressionTestHeader was called at the beginning of the test.

NB: See the 'nota bene' appended to the documentation of function printRegressionTestHeader

Parameters:
outFile the file to which the regression test output is written
testName the name of the test case
msg the message describing the outcome of the test case
See also:
printRegressionTestHeader
Version:
1.0
Author:
A. Pasetti

Definition at line 78 of file TestUtilities.cpp.

void printRegressionTestHeader FILE *  outFile  ) 
 

Print the header of the regression test report.

This function should be called before any of the test cases are executed. If this function is called, then function printRegressionTestTail should also be called to print the close out of the regression test report.

NB: This function is intended for use in a desktop environment where a file system is available. However, it can also be used in embedded environment provided that the printf library function is available. For this type of usage, the function should be recompiled after having undefined the MS_HOST #define variable.

Parameters:
outFile the file to which the regression test output is written
See also:
printRegressionTestTail
Version:
1.0
Author:
A. Pasetti

Definition at line 16 of file TestUtilities.cpp.

void printRegressionTestTail FILE *  outFile  ) 
 

Print the close out of the regression test report.

This function should be called after all the test cases have been executed. This function assumes that function printRegressionTestHeader was called at the beginning of the test run.

NB: See the 'nota bene' appended to the documentation of function printRegressionTestHeader

Parameters:
outFile the file to which the regression test output is written
See also:
printRegressionTestHeader
Version:
1.0
Author:
A. Pasetti

Definition at line 52 of file TestUtilities.cpp.

void printTestFailed FILE *  outFile,
char *  testName,
char *  testMsg
 

Print a message describing the outcome of a test case to an output file.

This function should only be called if function printRegressionTestHeader was called at the beginning of the test run and if the test case failed.

NB: See the 'nota bene' appended to the documentation of function printRegressionTestHeader

Parameters:
outFile the file to which the regression test output is written
testName the name of the test case
testMsg the message describing the outcome of the test case
See also:
printRegressionTestHeader
Version:
1.0
Author:
A. Pasetti

Definition at line 68 of file TestUtilities.cpp.

void printTestSuccess FILE *  outFile,
char *  testName,
char *  testMsg
 

Print a message describing the outcome of a test case to an output file.

This function should only be called if function printRegressionTestHeader was called at the beginning of the test run and if the test case was successful.

NB: See the 'nota bene' appended to the documentation of function printRegressionTestHeader

Parameters:
outFile the file to which the regression test output is written
testName the name of the test case
testMsg the message describing the outcome of the test case
See also:
printRegressionTestHeader
Version:
1.0
Author:
A. Pasetti

Definition at line 58 of file TestUtilities.cpp.

Copyright 2003 P&P Software GmbH - All Rights Reserved