|
CTK_CORE_EXPORT bool | CheckInt (int line, const QString &description, int current, int expected) |
|
CTK_CORE_EXPORT bool | CheckNotNull (int line, const QString &description, const void *pointer) |
|
CTK_CORE_EXPORT bool | CheckNull (int line, const QString &description, const void *pointer) |
|
CTK_CORE_EXPORT bool | CheckPointer (int line, const QString &description, void *current, void *expected, bool errorIfDifferent=true) |
|
CTK_CORE_EXPORT bool | CheckString (int line, const QString &description, const char *current, const char *expected, bool errorIfDifferent=true) |
|
CTK_CORE_EXPORT bool | CheckStringList (int line, const QString &description, const QStringList ¤t, const QStringList &expected) |
|
CTK_CORE_EXPORT bool | CheckVariant (int line, const QString &description, const QVariant ¤t, const QVariant &expected) |
|
This module provides functions to facilitate writing tests.
Before using this module, first consider the QTestLib unit testing framework available in Qt.
Example:
int current = 40 + 2;
int expected = 43;
if (!
CheckInt(__LINE__,
"40 + 2", current, expected))
{
return false;
}
CTK_CORE_EXPORT bool CheckInt(int line, const QString &description, int current, int expected)
Usually these test methods are used by single-line convenience macros defined in ctkCoreTestingMacros.h.