00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
#include "../GeneralInclude/CompilerSwitches.h"
00011
#include "../GeneralInclude/TestCompilerSwitches.h"
00012
#include "../GeneralInclude/DebugSupport.h"
00013
#include "../GeneralInclude/Constants.h"
00014
#include "../GeneralInclude/TestConstants.h"
00015
#include "../GeneralInclude/ClassId.h"
00016
#include "DC_TestTracer.h"
00017
#include <time.h>
00018
00019 DC_TestTracer::DC_TestTracer(
void) {
00020 logFile = pNULL;
00021
#ifdef MS_HOST
00022
if( (logFile = fopen(
TEST_TRACER_LOG_FILE,
"w")) == pNULL )
00023 printf(
"\nThe file %s could not be opened\n",
TEST_TRACER_LOG_FILE);
00024
else
00025 printf(
"\nThe file %s was successfully opened\n",
TEST_TRACER_LOG_FILE);
00026
00027
00028 time_t ltime;
00029 time( <ime );
00030 fprintf(logFile,
"Test Tracer Log File\n");
00031 fprintf(logFile,
"Test Run Performed on %s\n",ctime( <ime ));
00032
#else
00033
printf(
"Test Tracer Log File\n");
00034 printf(
"\n");
00035
#endif
00036
00037
00038 setClassId(ID_TESTTRACER);
00039 }
00040
00041 void DC_TestTracer::sendRawTrace(
TD_TraceItem rawItem)
const {
00042
#ifdef MS_HOST
00043
assert( logFile != pNULL);
00044 fprintf(logFile,
"Raw_Tracer_Item: %x\n", rawItem);
00045
#else
00046
printf(
"Raw Tracer Item: %x\n", rawItem);
00047
#endif
00048
}
00049
00050 void DC_TestTracer::closeLogFile(
void) {
00051
#ifdef MS_HOST
00052
assert( logFile != pNULL);
00053 fclose(logFile);
00054 logFile = pNULL;
00055
#endif
00056
}
00057
00058 const char*
const DC_TestTracer::getLogFileName(
void) {
00059
#ifdef MS_HOST
00060
return TEST_TRACER_LOG_FILE;
00061
#else
00062
return pNULL;
00063
#endif
00064
}