Loading...
Searching...
No Matches
TeeListener.h
Go to the documentation of this file.
#ifndef __cxxtest__TeeListener_h__
#define __cxxtest__TeeListener_h__
//
// A TeeListener notifies two "reular" TestListeners
//
#include <cxxtest/TestListener.h>
#include <cxxtest/TestListener.h>
namespace CxxTest
{
class TeeListener : public TestListener
{
public:
TeeListener()
{
setFirst( _dummy );
setSecond( _dummy );
}
virtual ~TeeListener()
{
}
void setFirst( TestListener &first )
{
_first = &first;
}
void setSecond( TestListener &second )
{
_second = &second;
}
void enterWorld( const WorldDescription &d )
{
_first->enterWorld( d );
_second->enterWorld( d );
}
void enterSuite( const SuiteDescription &d )
{
_first->enterSuite( d );
_second->enterSuite( d );
}
void enterTest( const TestDescription &d )
{
_first->enterTest( d );
_second->enterTest( d );
}
void trace( const char *file, unsigned line, const char *expression )
{
_first->trace( file, line, expression );
_second->trace( file, line, expression );
}
void warning( const char *file, unsigned line, const char *expression )
{
_first->warning( file, line, expression );
_second->warning( file, line, expression );
}
void failedTest( const char *file, unsigned line, const char *expression )
{
_first->failedTest( file, line, expression );
_second->failedTest( file, line, expression );
}
void failedAssert( const char *file, unsigned line, const char *expression )
{
_first->failedAssert( file, line, expression );
_second->failedAssert( file, line, expression );
}
void failedAssertEquals( const char *file, unsigned line,
const char *xStr, const char *yStr,
const char *x, const char *y )
{
_first->failedAssertEquals( file, line, xStr, yStr, x, y );
_second->failedAssertEquals( file, line, xStr, yStr, x, y );
}
void failedAssertSameData( const char *file, unsigned line,
const char *xStr, const char *yStr,
const char *sizeStr, const void *x,
const void *y, unsigned size )
{
_first->failedAssertSameData( file, line, xStr, yStr, sizeStr, x, y, size );
_second->failedAssertSameData( file, line, xStr, yStr, sizeStr, x, y, size );
}
void failedAssertDelta( const char *file, unsigned line,
const char *xStr, const char *yStr, const char *dStr,
const char *x, const char *y, const char *d )
{
_first->failedAssertDelta( file, line, xStr, yStr, dStr, x, y, d );
_second->failedAssertDelta( file, line, xStr, yStr, dStr, x, y, d );
}
void failedAssertDiffers( const char *file, unsigned line,
const char *xStr, const char *yStr,
const char *value )
{
_first->failedAssertDiffers( file, line, xStr, yStr, value );
_second->failedAssertDiffers( file, line, xStr, yStr, value );
}
void failedAssertLessThan( const char *file, unsigned line,
const char *xStr, const char *yStr,
const char *x, const char *y )
{
_first->failedAssertLessThan( file, line, xStr, yStr, x, y );
_second->failedAssertLessThan( file, line, xStr, yStr, x, y );
}
void failedAssertLessThanEquals( const char *file, unsigned line,
const char *xStr, const char *yStr,
const char *x, const char *y )
{
_first->failedAssertLessThanEquals( file, line, xStr, yStr, x, y );
_second->failedAssertLessThanEquals( file, line, xStr, yStr, x, y );
}
void failedAssertPredicate( const char *file, unsigned line,
const char *predicate, const char *xStr, const char *x )
{
_first->failedAssertPredicate( file, line, predicate, xStr, x );
_second->failedAssertPredicate( file, line, predicate, xStr, x );
}
void failedAssertRelation( const char *file, unsigned line,
const char *relation, const char *xStr, const char *yStr,
const char *x, const char *y )
{
_first->failedAssertRelation( file, line, relation, xStr, yStr, x, y );
_second->failedAssertRelation( file, line, relation, xStr, yStr, x, y );
}
void failedAssertThrows( const char *file, unsigned line,
const char *expression, const char *type,
bool otherThrown )
{
_first->failedAssertThrows( file, line, expression, type, otherThrown );
_second->failedAssertThrows( file, line, expression, type, otherThrown );
}
void failedAssertThrowsNot( const char *file, unsigned line,
const char *expression )
{
_first->failedAssertThrowsNot( file, line, expression );
_second->failedAssertThrowsNot( file, line, expression );
}
void leaveTest( const TestDescription &d )
{
_first->leaveTest(d);
_second->leaveTest(d);
}
void leaveSuite( const SuiteDescription &d )
{
_first->leaveSuite(d);
_second->leaveSuite(d);
}
void leaveWorld( const WorldDescription &d )
{
_first->leaveWorld(d);
_second->leaveWorld(d);
}
private:
TestListener *_first, *_second;
TestListener _dummy;
};
};
#endif // __cxxtest__TeeListener_h__
TestListener.h
size
int size(const CanonicalForm &f, const Variable &v)
int size ( const CanonicalForm & f, const Variable & v )
Definition cf_ops.cc:600
x
Variable x
Definition cfModGcd.cc:4090
CxxTest::SuiteDescription
Definition Descriptions.h:32
CxxTest::TeeListener::_first
TestListener * _first
Definition TeeListener.h:176
CxxTest::TeeListener::failedAssertThrows
void failedAssertThrows(const char *file, unsigned line, const char *expression, const char *type, bool otherThrown)
Definition TeeListener.h:142
CxxTest::TeeListener::enterTest
void enterTest(const TestDescription &d)
Definition TeeListener.h:48
CxxTest::TeeListener::failedAssertThrowsNot
void failedAssertThrowsNot(const char *file, unsigned line, const char *expression)
Definition TeeListener.h:150
CxxTest::TeeListener::failedAssertDiffers
void failedAssertDiffers(const char *file, unsigned line, const char *xStr, const char *yStr, const char *value)
Definition TeeListener.h:103
CxxTest::TeeListener::failedAssertEquals
void failedAssertEquals(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition TeeListener.h:78
CxxTest::TeeListener::~TeeListener
virtual ~TeeListener()
Definition TeeListener.h:22
CxxTest::TeeListener::TeeListener
TeeListener()
Definition TeeListener.h:16
CxxTest::TeeListener::warning
void warning(const char *file, unsigned line, const char *expression)
Definition TeeListener.h:60
CxxTest::TeeListener::failedAssertDelta
void failedAssertDelta(const char *file, unsigned line, const char *xStr, const char *yStr, const char *dStr, const char *x, const char *y, const char *d)
Definition TeeListener.h:95
CxxTest::TeeListener::failedAssert
void failedAssert(const char *file, unsigned line, const char *expression)
Definition TeeListener.h:72
CxxTest::TeeListener::failedAssertSameData
void failedAssertSameData(const char *file, unsigned line, const char *xStr, const char *yStr, const char *sizeStr, const void *x, const void *y, unsigned size)
Definition TeeListener.h:86
CxxTest::TeeListener::_second
TestListener * _second
Definition TeeListener.h:176
CxxTest::TeeListener::setFirst
void setFirst(TestListener &first)
Definition TeeListener.h:26
CxxTest::TeeListener::leaveSuite
void leaveSuite(const SuiteDescription &d)
Definition TeeListener.h:163
CxxTest::TeeListener::leaveTest
void leaveTest(const TestDescription &d)
Definition TeeListener.h:157
CxxTest::TeeListener::trace
void trace(const char *file, unsigned line, const char *expression)
Definition TeeListener.h:54
CxxTest::TeeListener::enterSuite
void enterSuite(const SuiteDescription &d)
Definition TeeListener.h:42
CxxTest::TeeListener::leaveWorld
void leaveWorld(const WorldDescription &d)
Definition TeeListener.h:169
CxxTest::TeeListener::failedAssertLessThan
void failedAssertLessThan(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition TeeListener.h:111
CxxTest::TeeListener::enterWorld
void enterWorld(const WorldDescription &d)
Definition TeeListener.h:36
CxxTest::TeeListener::failedAssertRelation
void failedAssertRelation(const char *file, unsigned line, const char *relation, const char *xStr, const char *yStr, const char *x, const char *y)
Definition TeeListener.h:134
CxxTest::TeeListener::failedAssertPredicate
void failedAssertPredicate(const char *file, unsigned line, const char *predicate, const char *xStr, const char *x)
Definition TeeListener.h:127
CxxTest::TeeListener::failedTest
void failedTest(const char *file, unsigned line, const char *expression)
Definition TeeListener.h:66
CxxTest::TeeListener::_dummy
TestListener _dummy
Definition TeeListener.h:177
CxxTest::TeeListener::setSecond
void setSecond(TestListener &second)
Definition TeeListener.h:31
CxxTest::TeeListener::failedAssertLessThanEquals
void failedAssertLessThanEquals(const char *file, unsigned line, const char *xStr, const char *yStr, const char *x, const char *y)
Definition TeeListener.h:119
CxxTest::TestDescription
Definition Descriptions.h:16
CxxTest::TestListener::TestListener
TestListener()
Definition TestListener.h:20
CxxTest::WorldDescription
Definition Descriptions.h:54
y
const CanonicalForm int const CFList const Variable & y
Definition facAbsFact.cc:53
CxxTest
Definition Descriptions.cpp:7