home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 Mobile
/
Chip_Mobile_2001.iso
/
palm
/
business
/
printcar
/
printcar.exe
/
tests
/
Test.cc
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-03
|
1KB
|
55 lines
//
// $Id: Test.cc,v 1.1.1.1 2000/06/02 22:22:57 sergey Exp $
//
#include "Test.h"
//==============================================================================
// Test case
//==============================================================================
void Test::run(TestResult& result)
{
_testResult = &result;
#ifdef NOEXCEPTIONS
runTest();
#else
try
{
runTest();
}
catch(TestError& ex)
{
result.logError(name(), ex);
}
catch(...)
{
result.logError(name(), TestError("Unknown error", __FILE__, __LINE__));
}
#endif // NOEXCEPTIONS
if (_errors == 0)
result.logMessage(name(), "OK");
}
void Test::checkAssert(bool condition, const char* comment, const char* file, int line)
{
// Currently (03.05.2000) PRC-Tools does not support the exception handling,
// this is a work around.
if (!condition)
{
++_errors;
#ifdef NOEXCEPTIONS
_testResult->logError(name(), TestError(comment, file, line));
#else
throw TestError(comment, file, line);
#endif // NOEXCEPTIONS
}
}