KUnitTest
#include <iostream>
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <QtCore/QHash>
#include <QtCore/QTextStream>
#include "kunittest_export.h"
Go to the source code of this file.
Classes | |
class | KUnitTest::SlotTester |
class | KUnitTest::Tester |
class | KUnitTest::TestResults |
Namespaces | |
namespace | KUnitTest |
Macros | |
#define | CHECK(x, y) check( __FILE__, __LINE__, #x, x, y, false ) |
#define | CHECK_EXCEPTION(exceptionCatch, expression) |
#define | SKIP(x) skip( __FILE__, __LINE__, QLatin1String(#x)) |
#define | SKIP_EXCEPTION(exceptionCatch, expression) |
#define | VERIFY(cond) check( __FILE__, __LINE__, #cond, cond, true, false ) |
#define | XFAIL(x, y) check( __FILE__, __LINE__, #x, x, y, true ) |
#define | XFAIL_EXCEPTION(exceptionCatch, expression) |
Typedefs | |
typedef QHash< QByteArray, TestResults * > | KUnitTest::TestResultsList |
Functions | |
QTextStream & | operator<< (QTextStream &str, const QPoint &r) |
QTextStream & | operator<< (QTextStream &str, const QRect &r) |
QTextStream & | operator<< (QTextStream &str, const QSize &r) |
Macro Definition Documentation
◆ CHECK
#define CHECK | ( | x, | |
y | |||
) | check( __FILE__, __LINE__, #x, x, y, false ) |
Use this macro to perform an equality check. For example
◆ CHECK_EXCEPTION
#define CHECK_EXCEPTION | ( | exceptionCatch, | |
expression | |||
) |
An macro testing that expression
throws an exception that is caught with exceptionCatch
. Use it to test that an expression, such as a function call, throws a certain exception.
- Note
- this macro assumes it's used in a function which is a sub-class of the Tester class.
◆ SKIP
#define SKIP | ( | x | ) | skip( __FILE__, __LINE__, QLatin1String(#x)) |
Use this macro to indicate that a test is skipped.
◆ SKIP_EXCEPTION
#define SKIP_EXCEPTION | ( | exceptionCatch, | |
expression | |||
) |
This macro is similar to SKIP, but is for exceptions instead. Skip testing expression
and the exceptionCatch
which is supposed to catch the exception, and register the test as being skipped.
◆ VERIFY
#define VERIFY | ( | cond | ) | check( __FILE__, __LINE__, #cond, cond, true, false ) |
Use this macro to check that a boolean condition is true. For example
◆ XFAIL
#define XFAIL | ( | x, | |
y | |||
) | check( __FILE__, __LINE__, #x, x, y, true ) |
Use this macro to perform a check you expect to fail. For example
If the test fails, it will be counted as such, however it will also be registered separately.
◆ XFAIL_EXCEPTION
#define XFAIL_EXCEPTION | ( | exceptionCatch, | |
expression | |||
) |
This macro is similar to XFAIL, but is for exceptions instead. Flags expression
as being expected to fail to throw an exception that exceptionCatch
is supposed to catch.
Function Documentation
◆ operator<<() [1/3]
QTextStream & operator<< | ( | QTextStream & | str, |
const QPoint & | r | ||
) |
Definition at line 107 of file tester.cpp.
◆ operator<<() [2/3]
QTextStream & operator<< | ( | QTextStream & | str, |
const QRect & | r | ||
) |
Definition at line 102 of file tester.cpp.
◆ operator<<() [3/3]
QTextStream & operator<< | ( | QTextStream & | str, |
const QSize & | r | ||
) |
Definition at line 112 of file tester.cpp.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.