KD Chart 2  [rev.2.7]
Classes | Namespaces | Macros
test.h File Reference
#include "kdchart_export.h"
#include "kdganttglobal.h"
#include <QtGlobal>
#include <string>
#include <iostream>
#include "testregistry.h"
#include "libutil.h"

Go to the source code of this file.

Classes

class  KDAB::UnitTest::GenericFactory< T_Test >
 
class  KDAB::UnitTest::Test
 
class  KDAB::UnitTest::TestFactory
 

Namespaces

 KDAB
 
 KDAB::UnitTest
 

Macros

#define assertDoesNotThrowException(x, E)
 
#define assertEqual(x, y)   _assertEqual( (x), (y), #x, #y, __FILE__, __LINE__ )
 
#define assertEqualWithEpsilons(x, y, z)   _assertEqualWithEpsilons( (x), (y), (z), #x, #y, #z, __FILE__, __LINE__ )
 
#define assertFalse(x)   _assertFalse( (x), #x, __FILE__, __LINE__ )
 
#define assertNearEqual(x, y, z)
 
#define assertNotEqual(x, y)   _assertNotEqual( (x), (y), #x, #y, __FILE__, __LINE__ )
 
#define assertNotNull(x)   _assertNotNull( ( x ), #x, __FILE__, __LINE__ )
 
#define assertNull(x)   _assertNull( ( x ), #x, __FILE__, __LINE__ )
 
#define assertThrowsException(x, E)   assertThrowsExceptionWithCode( x, E, do{}while (0) )
 
#define assertThrowsExceptionWithCode(x, E, code)
 
#define assertTrue(x)   _assertTrue( (x), #x, __FILE__, __LINE__ )
 
#define KDAB_EXPORT_SCOPED_UNITTEST(Namespace, Class, Group)
 
#define KDAB_EXPORT_UNITTEST(Class, Group)
 
#define KDAB_IMPORT_UNITTEST(Class)   KDAB_IMPORT_STATIC_SYMBOLS( Class )
 
#define KDAB_SCOPED_UNITTEST_SIMPLE(Namespace, Class, Group)
 
#define KDAB_UNITTEST_SIMPLE(Class, Group)
 

Macro Definition Documentation

#define assertDoesNotThrowException (   x,
 
)
Value:
do { \
try { \
x; \
success(); \
} catch ( E & ) { \
fail( __FILE__, __LINE__ ) \
<< "\"" #x "\" threw \"" #E "\", but shouldn't" << std::endl; \
} catch ( ... ) { \
fail( __FILE__, __LINE__ ) \
<< "\"" #x "\" threw something, but it wasn't \"" #E "\"" << std::endl; \
} \
} while ( false )

Definition at line 71 of file test.h.

#define assertEqual (   x,
 
)    _assertEqual( (x), (y), #x, #y, __FILE__, __LINE__ )

Definition at line 43 of file test.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

#define assertEqualWithEpsilons (   x,
  y,
 
)    _assertEqualWithEpsilons( (x), (y), (z), #x, #y, #z, __FILE__, __LINE__ )

Definition at line 47 of file test.h.

#define assertFalse (   x)    _assertFalse( (x), #x, __FILE__, __LINE__ )

Definition at line 42 of file test.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

#define assertNearEqual (   x,
  y,
 
)

Definition at line 46 of file test.h.

#define assertNotEqual (   x,
 
)    _assertNotEqual( (x), (y), #x, #y, __FILE__, __LINE__ )

Definition at line 44 of file test.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

#define assertNotNull (   x)    _assertNotNull( ( x ), #x, __FILE__, __LINE__ )

Definition at line 39 of file test.h.

#define assertNull (   x)    _assertNull( ( x ), #x, __FILE__, __LINE__ )

Definition at line 40 of file test.h.

#define assertThrowsException (   x,
 
)    assertThrowsExceptionWithCode( x, E, do{}while (0) )

Definition at line 69 of file test.h.

#define assertThrowsExceptionWithCode (   x,
  E,
  code 
)
Value:
do { \
try { \
x; \
fail( __FILE__, __LINE__ ) \
<< "\"" #x "\" didn't throw \"" #E "\"" << std::endl; \
} catch ( E & ppq_ut_thrown ) { \
success(); \
( void )ppq_ut_thrown; \
code; \
} catch ( ... ) { \
fail( __FILE__, __LINE__ ) \
<< "\"" #x "\" threw something, but it wasn't \"" #E "\"" << std::endl; \
} \
} while ( false )

Definition at line 53 of file test.h.

#define assertTrue (   x)    _assertTrue( (x), #x, __FILE__, __LINE__ )

Definition at line 41 of file test.h.

Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().

#define KDAB_EXPORT_SCOPED_UNITTEST (   Namespace,
  Class,
  Group 
)
Value:
static const KDAB::UnitTest::GenericFactory< Namespace::Class > __##Class##_unittest( Group ); \
#define KDAB_EXPORT_STATIC_SYMBOLS(ID)
Definition: libutil.h:33

Definition at line 173 of file test.h.

#define KDAB_EXPORT_UNITTEST (   Class,
  Group 
)
Value:
static const KDAB::UnitTest::GenericFactory< Class > __##Class##_unittest( Group ); \
#define KDAB_EXPORT_STATIC_SYMBOLS(ID)
Definition: libutil.h:33

Definition at line 169 of file test.h.

#define KDAB_IMPORT_UNITTEST (   Class)    KDAB_IMPORT_STATIC_SYMBOLS( Class )

Definition at line 178 of file test.h.

#define KDAB_SCOPED_UNITTEST_SIMPLE (   Namespace,
  Class,
  Group 
)
Value:
namespace Namespace { \
class Class##Test : public KDAB::UnitTest::Test { \
public: \
Class##Test() : Test( #Namespace "::" #Class ) {} \
void run(); \
}; \
} \
KDAB_EXPORT_SCOPED_UNITTEST( Namespace, Class##Test, Group ) \
void Namespace::Class##Test::run()
#define KDAB_EXPORT_SCOPED_UNITTEST(Namespace, Class, Group)
Definition: test.h:173

Definition at line 191 of file test.h.

#define KDAB_UNITTEST_SIMPLE (   Class,
  Group 
)
Value:
class Class##Test : public KDAB::UnitTest::Test { \
public: \
Class##Test() : Test( #Class ) {} \
void run(); \
}; \
KDAB_EXPORT_UNITTEST( Class##Test, Group ) \
void Class##Test::run()
virtual void run()=0
#define KDAB_EXPORT_UNITTEST(Class, Group)
Definition: test.h:169
Test(const std::string &name)
Definition: test.cpp:34

Definition at line 182 of file test.h.


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/