KD Chart 2  [rev.2.7]
Public Member Functions | Protected Member Functions | List of all members
KDAB::UnitTest::Test Class Referenceabstract

#include <test.h>

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

References fail(), and success().

Referenced by succeeded().

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::_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().

Referenced by succeeded().

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.

References fail(), and success().

Referenced by succeeded().

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 d, fail(), and success().

Referenced by succeeded().

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().

Referenced by succeeded().

std::ostream & KDAB::UnitTest::Test::fail ( const char *  file,
unsigned int  line 
)
protected
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

Referenced by succeeded().

unsigned int KDAB::UnitTest::Test::succeeded ( ) const
void KDAB::UnitTest::Test::success ( )
protected

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

Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/

https://www.kdab.com/development-resources/qt-tools/kd-chart/