Menu

[r344]: / trunk / cppunit / src / cppunit / Protector.cpp  Maximize  Restore  History

Download this file

42 lines (32 with data), 866 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <cppunit/Exception.h>
#include <cppunit/Message.h>
#include <cppunit/Protector.h>
#include <cppunit/TestResult.h>
#include "ProtectorContext.h"
CPPUNIT_NS_BEGIN
Functor::~Functor()
{
}
Protector::~Protector()
{
}
void
Protector::reportTestFailure( const Message &message,
const ProtectorContext &context,
bool isError )
{
Message actualMessage;
if ( context.m_shortDescription.empty() )
actualMessage = message;
else
{
actualMessage = Message( context.m_shortDescription,
message.shortDescription() );
actualMessage.addDetail( message );
}
if ( isError )
context.m_result->addError( context.m_test, new Exception( message ) );
else
context.m_result->addFailure( context.m_test, new Exception( message ) );
}
CPPUNIT_NS_END
MongoDB Logo MongoDB