KD Chart 2  [rev.2.5]
Public Member Functions | Protected Member Functions
KDAB::UnitTest::Test Class Reference

#include <test.h>

List of all members.

Public Member Functions

unsigned int failed () const
const std::string & name () const
virtual void run ()=0
unsigned int succeeded () const
 Test (const std::string &name)
virtual ~Test ()

Protected Member Functions

template<typename T , typename S >
void _assertEqual (const T &x1, const S &x2, const char *expr1, const char *expr2, const char *file, unsigned int line)
void _assertEqualWithEpsilons (float x1, float x2, int prec, const char *expr1, const char *expr2, const char *exprPrec, const char *file, unsigned int line)
void _assertEqualWithEpsilons (qreal x1, qreal x2, int prec, const char *expr1, const char *expr2, const char *exprPrec, const char *file, unsigned int line)
void _assertEqualWithEpsilons (long double x1, long double x2, int prec, const char *expr1, const char *expr2, const char *exprPrec, const char *file, unsigned int line)
void _assertFalse (bool x, const char *expression, const char *file, unsigned int line)
template<typename T , typename S >
void _assertNotEqual (const T &x1, const S &x2, const char *expr1, const char *expr2, const char *file, unsigned int line)
void _assertNotNull (const void *x, const char *expression, const char *file, unsigned int line)
void _assertNull (const void *x, const char *expression, const char *file, unsigned int line)
void _assertTrue (bool x, const char *expression, const char *file, unsigned int line)
std::ostream & fail (const char *file, unsigned int line)
void success ()

Detailed Description

Definition at line 86 of file test.h.


Constructor & Destructor Documentation

KDAB::UnitTest::Test::Test ( const std::string &  name)

Definition at line 34 of file test.cpp.

virtual KDAB::UnitTest::Test::~Test ( ) [virtual]

Definition at line 91 of file test.h.


Member Function Documentation

template<typename T , typename S >
void KDAB::UnitTest::Test::_assertEqual ( const T &  x1,
const S &  x2,
const char *  expr1,
const char *  expr2,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 114 of file test.h.

References fail(), and success().

void KDAB::UnitTest::Test::_assertEqualWithEpsilons ( float  x1,
float  x2,
int  prec,
const char *  expr1,
const char *  expr2,
const char *  exprPrec,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 69 of file test.cpp.

void KDAB::UnitTest::Test::_assertEqualWithEpsilons ( qreal  x1,
qreal  x2,
int  prec,
const char *  expr1,
const char *  expr2,
const char *  exprPrec,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 76 of file test.cpp.

void KDAB::UnitTest::Test::_assertEqualWithEpsilons ( long double  x1,
long double  x2,
int  prec,
const char *  expr1,
const char *  expr2,
const char *  exprPrec,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 83 of file test.cpp.

void KDAB::UnitTest::Test::_assertFalse ( bool  x,
const char *  expression,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 64 of file test.cpp.

template<typename T , typename S >
void KDAB::UnitTest::Test::_assertNotEqual ( const T &  x1,
const S &  x2,
const char *  expr1,
const char *  expr2,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 121 of file test.h.

References fail(), and success().

void KDAB::UnitTest::Test::_assertNotNull ( const void *  x,
const char *  expression,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 37 of file test.cpp.

void KDAB::UnitTest::Test::_assertNull ( const void *  x,
const char *  expression,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 42 of file test.cpp.

void KDAB::UnitTest::Test::_assertTrue ( bool  x,
const char *  expression,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 59 of file test.cpp.

std::ostream & KDAB::UnitTest::Test::fail ( const char *  file,
unsigned int  line 
) [protected]

Definition at line 90 of file test.cpp.

Referenced by _assertEqual(), and _assertNotEqual().

unsigned int KDAB::UnitTest::Test::failed ( ) const

Definition at line 94 of file test.h.

const std::string& KDAB::UnitTest::Test::name ( ) const

Definition at line 93 of file test.h.

virtual void KDAB::UnitTest::Test::run ( ) [pure virtual]
unsigned int KDAB::UnitTest::Test::succeeded ( ) const

Definition at line 95 of file test.h.

void KDAB::UnitTest::Test::success ( ) [protected]

Definition at line 130 of file test.h.

Referenced by _assertEqual(), and _assertNotEqual().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/