42 #include "QtTest/private/qtestresult_p.h" 43 #include <QtCore/qglobal.h> 45 #include "QtTest/private/qtestlog_p.h" 46 #include "QtTest/qtestdata.h" 47 #include "QtTest/qtestassert.h" 145 addFailure(
"Not all expected messages were received", 0, 0);
170 :
static_cast<const char *
>(0);
176 :
static_cast<const char *
>(0);
181 if (!dataIndex || dataIndex[0] ==
'\0')
204 addFailure(
"Already expecting a fail", file, line);
213 static bool checkStatement(
bool statement,
const char *msg,
const char *file,
int line)
239 const char *description,
const char *file,
int line)
248 QTest::qt_snprintf(msg, 1024,
"'%s' returned FALSE. (%s)", statementStr, description);
263 const char *actual,
const char *expected,
const char *file,
int line)
269 return compare(success, msg, file, line);
273 actual, val1 ? val1 :
"<null>",
274 expected, val2 ? val2 :
"<null>");
277 return compare(success, buf, file, line);
291 const char *file,
int line)
static const char * currentTestFunction()
static int verboseLevel()
static void addPass(const char *msg)
#define QT_END_NAMESPACE
This macro expands to.
static const char * currentAppName
SkipMode
This enum describes the modes for skipping tests during execution of the test data.
static void setCurrentTestLocation(TestLocation loc)
static bool skipCurrentTest
const char * dataTag() const
static void ignoreMessage(QtMsgType type, const char *msg)
static const char * currentTestFunc
static void setCurrentTestFunction(const char *func)
static void addFailure(const char *message, const char *file, int line)
static void addSkip(const char *message, QTest::SkipMode mode, const char *file, int line)
static TestLocation currentTestLocation()
QtMsgType
This enum describes the messages that can be sent to a message handler (QtMsgHandler).
static int expectFailMode
static bool expectFail(const char *dataIndex, const char *comment, QTest::TestFailMode mode, const char *file, int line)
static void enterTestFunction(const char *function)
static int unhandledIgnoreMessages()
static void printUnhandledIgnoreMessages()
static void addSkip(const char *msg, QTest::SkipMode mode, const char *file, int line)
static void finishedCurrentTestFunction()
static void addFail(const char *msg, const char *file, int line)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static const char * currentTestObjectName()
static bool compare(const QVariant::Private *a, const QVariant::Private *b)
Compares a to b.
static QTestData * currentTestData()
static bool verify(bool statement, const char *statementStr, const char *extraInfo, const char *file, int line)
static void clearExpectFail()
static const char * currentAppName()
static const char * data(const QByteArray &arr)
static QTestData * currentGlobalTestData()
static bool compare(bool success, const char *msg, const char *file, int line)
static bool isExpectFailData(const char *dataIndex)
int Q_TESTLIB_EXPORT qt_snprintf(char *str, int size, const char *format,...)
static const char * currentGlobalDataTag()
static void setCurrentGlobalTestData(QTestData *data)
static void setCurrentTestData(QTestData *data)
static bool checkStatement(bool statement, const char *msg, const char *file, int line)
#define QTEST_ASSERT(cond)
static QTestResult::TestLocation location
static void setSkipCurrentTest(bool value)
static void setCurrentAppName(const char *appName)
TestFailMode
This enum describes the modes for handling an expected failure of the QVERIFY() or QCOMPARE() macros...
static const char * currentDataTag()
static void addXFail(const char *msg, const char *file, int line)
static bool skipCurrentTest()
static bool currentTestFailed()
static bool allDataPassed()
static QTestData * currentTestData
static const char * expectFailComment
static void info(const char *msg, const char *file, int line)
static void setCurrentTestObject(const char *name)
The QTest namespace contains all the functions and declarations that are related to the QTestLib tool...
static void addXPass(const char *msg, const char *file, int line)
static const char * currentTestObjectName
static QTestData * currentGlobalTestData
static void addIgnoreMessage(QtMsgType type, const char *msg)
static void leaveTestFunction()