version 1.26, 2006/01/30 16:17:30
|
version 1.27, 2006/06/20 16:51:32
|
|
|
file.read(readStr.get(),size+EOF_CHAR); | file.read(readStr.get(),size+EOF_CHAR); |
(readStr.get())[size]='\0'; | (readStr.get())[size]='\0'; |
retCode=strcmp(compareStr,readStr.get()); | retCode=strcmp(compareStr,readStr.get()); |
|
|
|
/* Diagnostic to determnine string differences |
|
if (!retCode) |
|
cout << "Compare Error: compareStr= \n\"" << compareStr |
|
<< "\". readStr= \n\"" << readStr.get() << "\"" << endl; |
|
*/ |
|
|
file.close(); | file.close(); |
return retCode; | return retCode; |
} | } |
|
|
{ | { |
const char* METHOD_NAME = "test5"; | const char* METHOD_NAME = "test5"; |
Tracer::setTraceComponents("Wrong Component Name"); | Tracer::setTraceComponents("Wrong Component Name"); |
Tracer::traceExit(__FILE__,__LINE__,TRC_CONFIG,METHOD_NAME); |
|
|
PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME); |
|
PEG_METHOD_EXIT(); |
return(compare(FILE1,"Entering method test4")); | return(compare(FILE1,"Entering method test4")); |
} | } |
| |
|
|
{ | { |
const char* METHOD_NAME = "test7"; | const char* METHOD_NAME = "test7"; |
Tracer::setTraceLevel(100); | Tracer::setTraceLevel(100); |
Tracer::traceExit(__FILE__,__LINE__,TRC_CONFIG,METHOD_NAME); |
PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME); |
|
PEG_METHOD_EXIT(); |
return(compare(FILE1,"Test Message for Level2 in test6")); | return(compare(FILE1,"Test Message for Level2 in test6")); |
} | } |
| |
|
|
// return 0 if the test passed | // return 0 if the test passed |
// return 1 if the test failed | // return 1 if the test failed |
// | // |
|
// This test not required with change t0 |
|
// use and test macros only. |
| |
Uint32 test10() | Uint32 test10() |
{ | { |
const char* METHOD_NAME = "test10"; | const char* METHOD_NAME = "test10"; |
Tracer::setTraceComponents("ALL"); | Tracer::setTraceComponents("ALL"); |
Tracer::traceExit(__FILE__,__LINE__,Uint32(-1),METHOD_NAME); |
PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME); |
|
PEG_METHOD_EXIT(); |
return(compare(FILE2,"Test Message for Level3 in test9")); | return(compare(FILE2,"Test Message for Level3 in test9")); |
} | } |
| |
|
|
const char* METHOD_NAME = "test12"; | const char* METHOD_NAME = "test12"; |
Tracer::setTraceComponents("ALL"); | Tracer::setTraceComponents("ALL"); |
Tracer::setTraceLevel(Tracer::LEVEL4); | Tracer::setTraceLevel(Tracer::LEVEL4); |
Tracer::traceExit(__FILE__,__LINE__,TRC_CONFIG,METHOD_NAME); |
PEG_METHOD_ENTER(TRC_CONFIG,METHOD_NAME); |
|
PEG_METHOD_EXIT(); |
return(compare(FILE2,"Exiting method test12")); | return(compare(FILE2,"Exiting method test12")); |
} | } |
| |
|
|
cout << "Tracer test (test9) failed" << endl; | cout << "Tracer test (test9) failed" << endl; |
exit(1); | exit(1); |
} | } |
|
/*************************** |
|
Test 10 bypassed when tests changed to |
|
use macros. It did an invalid call which is |
|
not possible with macros |
|
|
if (test10() != 0) | if (test10() != 0) |
{ | { |
cout << "Tracer test (test10) failed" << endl; | cout << "Tracer test (test10) failed" << endl; |
exit(1); | exit(1); |
} | } |
|
******************************/ |
if (test11() != 0) | if (test11() != 0) |
{ | { |
cout << "Tracer test (test11) failed" << endl; | cout << "Tracer test (test11) failed" << endl; |