Public Member Functions | Protected Member Functions

KDAB::UnitTest::Test Class Reference

#include <test.h>

Collaboration diagram for KDAB::UnitTest::Test:
Collaboration graph
[legend]

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 (double x1, double 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 84 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 89 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 112 of file test.h.

References fail(), and success().

void KDAB::UnitTest::Test::_assertEqualWithEpsilons ( double  x1,
double  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.

References fail(), and success().

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.

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.

References fail(), and success().

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.

References fail(), and success().

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 119 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.

References fail(), and success().

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.

References fail(), and success().

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.

References fail(), and success().

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

Definition at line 92 of file test.h.

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

Definition at line 91 of file test.h.

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

Definition at line 93 of file test.h.

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

The documentation for this class was generated from the following files: