#include "kdchart_export.h"
#include "kdganttglobal.h"
#include <string>
#include <iostream>
#include "testregistry.h"
#include "../../kdchart_export.h"
#include "../kdganttglobal.h"
#include <map>
#include <vector>
#include <cassert>
Go to the source code of this file.
Classes | |
class | KDAB::UnitTest::GenericFactory< T_Test > |
class | KDAB::UnitTest::Test |
class | KDAB::UnitTest::TestFactory |
Namespaces | |
namespace | KDAB |
namespace | KDAB::UnitTest |
Defines | |
#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) |
#define assertDoesNotThrowException | ( | x, | |||
E | ) |
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 )
#define assertEqual | ( | x, | |||
y | ) | _assertEqual( (x), (y), #x, #y, __FILE__, __LINE__ ) |
Definition at line 41 of file test.h.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
#define assertEqualWithEpsilons | ( | x, | |||
y, | |||||
z | ) | _assertEqualWithEpsilons( (x), (y), (z), #x, #y, #z, __FILE__, __LINE__ ) |
#define assertFalse | ( | x | ) | _assertFalse( (x), #x, __FILE__, __LINE__ ) |
Definition at line 40 of file test.h.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
#define assertNotEqual | ( | x, | |||
y | ) | _assertNotEqual( (x), (y), #x, #y, __FILE__, __LINE__ ) |
Definition at line 42 of file test.h.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
#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 | ) |
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 )
#define assertTrue | ( | x | ) | _assertTrue( (x), #x, __FILE__, __LINE__ ) |
Definition at line 39 of file test.h.
Referenced by KDAB_SCOPED_UNITTEST_SIMPLE().
#define KDAB_EXPORT_SCOPED_UNITTEST | ( | Namespace, | |||
Class, | |||||
Group | ) |
static const KDAB::UnitTest::GenericFactory< Namespace::Class > __##Class##_unittest( Group ); \ KDAB_EXPORT_STATIC_SYMBOLS( Class )
#define KDAB_EXPORT_UNITTEST | ( | Class, | |||
Group | ) |
static const KDAB::UnitTest::GenericFactory< Class > __##Class##_unittest( Group ); \ KDAB_EXPORT_STATIC_SYMBOLS( Class )
#define KDAB_IMPORT_UNITTEST | ( | Class | ) | KDAB_IMPORT_STATIC_SYMBOLS( Class ) |
#define KDAB_SCOPED_UNITTEST_SIMPLE | ( | Namespace, | |||
Class, | |||||
Group | ) |
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_UNITTEST_SIMPLE | ( | Class, | |||
Group | ) |
class Class##Test : public KDAB::UnitTest::Test { \ public: \ Class##Test() : Test( #Class ) {} \ void run(); \ }; \ KDAB_EXPORT_UNITTEST( Class##Test, Group ) \ void Class##Test::run()