edbee - Qt Editor Library
Classes | Namespaces | Macros | Functions
test.h File Reference
#include <QObject>
#include <QString>
#include <QSharedPointer>
#include <QTextStream>
+ Include dependency graph for test.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  edbee::test::TestResult
 This method represents a test result. More...
 
class  edbee::test::TestCase
 I really really hate the QTestLib output on my Mac. It's a very ugly xwindows console result. More...
 
class  edbee::test::OutputHandler
 This is the basic outputhandler. The basic outputhandler simply executes a qDebug with the given information. More...
 
class  edbee::test::TestEngine
 This is the main test engine. More...
 
class  edbee::test::Test< T >
 

Namespaces

 edbee
 Copyright 2011-2013 - Reliable Bits Software by Blommers IT.
 
 edbee::test
 

Macros

#define TEST_CONCATENATE_DETAIL(x, y)   x##y
 Copyright 2011-2013 - Reliable Bits Software by Blommers IT. More...
 
#define TEST_CONCATENATE(x, y)   TEST_CONCATENATE_DETAIL(x, y)
 
#define TEST_MAKE_UNIQUE(x)   TEST_CONCATENATE(x, __COUNTER__)
 
#define DECLARE_TEST(className)   static edbee::test::Test<className> TEST_MAKE_UNIQUE(t)(#className)
 
#define DECLARE_NAMED_TEST(name, className)   static edbee::test::Test<className> TEST_MAKE_UNIQUE(name)(#className)
 
#define GET_3TH_ARG(arg1, arg2, arg3, ...)   arg3
 
#define GET_4TH_ARG(arg1, arg2, arg3, arg4, ...)   arg4
 
#define testTrue_1(statement)   testTrueImpl( ( statement ) ? true : false, #statement, "", __FILE__, __LINE__)
 
#define testTrue_2(statement, message)   testTrueImpl( ( statement ) ? true : false, #statement, (message), __FILE__, __LINE__ )
 
#define testTrue_MACRO_CHOOSER(...)   GET_3TH_ARG(__VA_ARGS__, testTrue_2, testTrue_1, )
 
#define testTrue(...)   testTrue_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
 
#define testFalse(statement)   testTrue( !statement )
 
#define testEqual_1(actual, expected)
 
#define testEqual_2(actual, expected, message)
 
#define testEqual_MACRO_CHOOSER(...)   GET_4TH_ARG(__VA_ARGS__, testEqual_2, testEqual_1, )
 
#define testEqual(...)   testEqual_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
 
#define testSkip(msg)   testSkipImpl( msg, __FILE__, __LINE__)
 

Functions

template<class T >
QString edbee::test::toQString (const T &obj)
 
TestEngine & edbee::test::engine ()
 

Macro Definition Documentation

◆ DECLARE_NAMED_TEST

#define DECLARE_NAMED_TEST (   name,
  className 
)    static edbee::test::Test<className> TEST_MAKE_UNIQUE(name)(#className)

◆ DECLARE_TEST

#define DECLARE_TEST (   className)    static edbee::test::Test<className> TEST_MAKE_UNIQUE(t)(#className)

◆ GET_3TH_ARG

#define GET_3TH_ARG (   arg1,
  arg2,
  arg3,
  ... 
)    arg3

◆ GET_4TH_ARG

#define GET_4TH_ARG (   arg1,
  arg2,
  arg3,
  arg4,
  ... 
)    arg4

◆ TEST_CONCATENATE

#define TEST_CONCATENATE (   x,
 
)    TEST_CONCATENATE_DETAIL(x, y)

◆ TEST_CONCATENATE_DETAIL

#define TEST_CONCATENATE_DETAIL (   x,
 
)    x##y

Copyright 2011-2013 - Reliable Bits Software by Blommers IT.

All Rights Reserved. Author Rick Blommers: Replace these tests with the standard Qt testing framework

◆ TEST_MAKE_UNIQUE

#define TEST_MAKE_UNIQUE (   x)    TEST_CONCATENATE(x, __COUNTER__)

◆ testEqual

#define testEqual (   ...)    testEqual_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)

◆ testEqual_1

#define testEqual_1 (   actual,
  expected 
)
Value:
do { \
QString actualStr = edbee::test::toQString(actual); \
QString expectedStr = edbee::test::toQString(expected); \
testEqualImpl( ( actualStr ) == ( expectedStr ), actualStr, expectedStr, #actual, #expected, "", __FILE__, __LINE__ ); \
} while( false )
QString toQString(const T &obj)
Definition: test.h:40

◆ testEqual_2

#define testEqual_2 (   actual,
  expected,
  message 
)
Value:
do \
QString actualStr = edbee::test::toQString(actual); \
QString expectedStr = edbee::test::toQString(expected); \
testEqualImpl( ( actualStr ) == ( expectedStr ), actualStr, expectedStr, #actual, #expected, (message), __FILE__, __LINE__ ); \
} while( false )
QString toQString(const T &obj)
Definition: test.h:40

◆ testEqual_MACRO_CHOOSER

#define testEqual_MACRO_CHOOSER (   ...)    GET_4TH_ARG(__VA_ARGS__, testEqual_2, testEqual_1, )

◆ testFalse

#define testFalse (   statement)    testTrue( !statement )

◆ testSkip

#define testSkip (   msg)    testSkipImpl( msg, __FILE__, __LINE__)

◆ testTrue

#define testTrue (   ...)    testTrue_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)

◆ testTrue_1

#define testTrue_1 (   statement)    testTrueImpl( ( statement ) ? true : false, #statement, "", __FILE__, __LINE__)

◆ testTrue_2

#define testTrue_2 (   statement,
  message 
)    testTrueImpl( ( statement ) ? true : false, #statement, (message), __FILE__, __LINE__ )

◆ testTrue_MACRO_CHOOSER

#define testTrue_MACRO_CHOOSER (   ...)    GET_3TH_ARG(__VA_ARGS__, testTrue_2, testTrue_1, )