Qt 4.8
|
The QTest namespace contains all the functions and declarations that are related to the QTestLib tool. More...
Classes | |
class | FatalSignalHandler |
struct | IgnoreResultList |
class | QBenchmarkIterationController |
The QBenchmarkIterationController class is used by the QBENCHMARK macro to drive the benchmarking loop. More... | |
struct | QTestDataSetter |
class | QTouchEventSequence |
The QTouchEventSequence class is used to simulate a sequence of touch events. More... | |
struct | TestFuncCleanup |
class | TestFunction |
Enumerations | |
enum | { IndentSpacesCount = 4 } |
enum | AttributeIndex { AI_Undefined = -1, AI_Name = 0, AI_Result = 1, AI_Tests = 2, AI_Failures = 3, AI_Errors = 4, AI_Type = 5, AI_Description = 6, AI_PropertyValue = 7, AI_QTestVersion = 8, AI_QtVersion = 9, AI_File = 10, AI_Line = 11, AI_Metric = 12, AI_Tag = 13, AI_Value = 14, AI_Iterations = 15 } |
This enum numbers the different tests. More... | |
enum | KeyAction { Press, Release, Click } |
This enum describes possible actions for key handling. More... | |
enum | LogElementType { LET_Undefined = -1, LET_Property = 0, LET_Properties = 1, LET_Failure = 2, LET_Error = 3, LET_TestCase = 4, LET_TestSuite = 5, LET_Benchmark = 6, LET_SystemError = 7 } |
The enum specifies the kinds of test log messages. More... | |
enum | MouseAction { MousePress, MouseRelease, MouseClick, MouseDClick, MouseMove } |
This enum describes possible actions for mouse handling. More... | |
enum | QBenchmarkMetric { FramesPerSecond, BitsPerSecond, BytesPerSecond, WalltimeMilliseconds, CPUTicks, InstructionReads, Events } |
This enum lists all the things that can be benchmarked. More... | |
enum | SkipMode { SkipSingle = 1, SkipAll = 2 } |
This enum describes the modes for skipping tests during execution of the test data. More... | |
enum | TestFailMode { Abort = 1, Continue = 2 } |
This enum describes the modes for handling an expected failure of the QVERIFY() or QCOMPARE() macros. More... | |
Functions | |
template<typename T > | |
void | addColumn (const char *name, T *=0) |
Adds a column with type T to the current test data. More... | |
Q_TESTLIB_EXPORT void | addColumnInternal (int id, const char *name) |
Q_TESTLIB_EXPORT Qt::Key | asciiToKey (char ascii) |
Convert an ascii char key value to a Qt Key value. More... | |
Q_TESTLIB_EXPORT void | beginBenchmarkMeasurement () |
const char * | benchmarkMetricName (QBenchmarkMetric metric) |
const char * | benchmarkMetricUnit (QBenchmarkMetric metric) |
static const char * | benchmarkResult2String () |
static const char * | benchmarkResultFormatString () |
Q_TESTLIB_EXPORT bool | compare_helper (bool success, const char *msg, const char *file, int line) |
Q_TESTLIB_EXPORT bool | compare_helper (bool success, const char *msg, char *val1, char *val2, const char *expected, const char *actual, const char *file, int line) |
bool | compare_ptr_helper (const void *t1, const void *t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT bool | compare_string_helper (const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
static int | countSignificantDigits (T num) |
Q_TESTLIB_EXPORT const char * | currentAppName () |
Returns the name of the binary that is currently executed. More... | |
Q_TESTLIB_EXPORT const char * | currentDataTag () |
Returns the name of the current test data. More... | |
Q_TESTLIB_EXPORT bool | currentTestFailed () |
Returns true if the current test function failed, otherwise false. More... | |
Q_TESTLIB_EXPORT const char * | currentTestFunction () |
Returns the name of the test function that is currently executed. More... | |
int | defaultEventDelay () |
int Q_TESTLIB_EXPORT | defaultKeyDelay () |
bool Q_TESTLIB_EXPORT | defaultKeyVerbose () |
int Q_TESTLIB_EXPORT | defaultMouseDelay () |
Q_TESTLIB_EXPORT quint64 | endBenchmarkMeasurement () |
void * | fetchData (QTestData *data, const char *tagName, int typeId) |
void | filter_unprintable (char *str) |
template<typename T > | |
QString | formatResult (T number, int significantDigits) |
template<typename T > | |
int | formatResult (char *buffer, int bufferSize, T number, int significantDigits) |
static bool | handleIgnoredMessage (QtMsgType type, const char *msg) |
Q_TESTLIB_EXPORT void | ignoreMessage (QtMsgType type, const char *message) |
Ignores messages created by qDebug() or qWarning(). More... | |
static const char * | incidentFormatString (bool noDescription, bool noTag) |
static const char * | incidentType2String (QAbstractTestLogger::IncidentTypes type) |
void | initLogger () |
static void | invokeMethod (QObject *obj, const char *methodName) |
static bool | isEmpty (const char *str) |
static bool | isValidSlot (const QMetaMethod &sl) |
int | iterationCount () |
static void | keyClick (QWidget *widget, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyClick (QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyClicks (QWidget *widget, const QString &sequence, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
Simulates clicking a sequence of keys on a widget. More... | |
static void | keyEvent (KeyAction action, QWidget *widget, char ascii, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyEvent (KeyAction action, QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyPress (QWidget *widget, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyPress (QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyRelease (QWidget *widget, char key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
static void | keyRelease (QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier=Qt::NoModifier, int delay=-1) |
Q_TESTLIB_EXPORT char | keyToAscii (Qt::Key key) |
Convert a Qt Key to an ascii char value. More... | |
static QByteArray | memberName (const QMetaMethod &member) |
static const char * | messageFormatString (bool noDescription, bool noTag) |
static void | messageHandler (QtMsgType type, const char *msg) |
static const char * | messageType2String (QAbstractTestLogger::MessageTypes type) |
void | mouseClick (QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1) |
Simulates clicking a mouse button with an optional modifier on a widget. More... | |
void | mouseDClick (QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1) |
Simulates double clicking a mouse button with an optional modifier on a widget. More... | |
static void | mouseEvent (MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1) |
void | mouseMove (QWidget *widget, QPoint pos=QPoint(), int delay=-1) |
Moves the mouse pointer to a widget. More... | |
void | mousePress (QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1) |
Simulates pressing a mouse button with an optional modifier on a widget. More... | |
void | mouseRelease (QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey=0, QPoint pos=QPoint(), int delay=-1) |
Simulates releasing a mouse button with an optional modifier on a widget. More... | |
Q_TESTLIB_EXPORT QTestData & | newRow (const char *dataTag) |
Appends a new row to the current test data. More... | |
static void | outputMessage (const char *str) |
static void | printBenchmarkResult (const QBenchmarkResult &result) |
static void | printMessage (const char *type, const char *msg, const char *file=0, int line=0) |
template<> | |
bool | qCompare (QIcon const &t1, QIcon const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (QPixmap const &t1, QPixmap const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (T const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (QString const &t1, QLatin1String const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (QLatin1String const &t1, QString const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (QStringList const &t1, QStringList const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (QFlags< T > const &t1, T const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 > | |
bool | qCompare (T1 const &, T2 const &, const char *, const char *, const char *, int) |
template<typename T > | |
bool | qCompare (QFlags< T > const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (const T *t1, const T *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T > | |
bool | qCompare (T *t1, T *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 > | |
bool | qCompare (const T1 *t1, const T2 *t2, const char *actual, const char *expected, const char *file, int line) |
template<typename T1 , typename T2 > | |
bool | qCompare (T1 *t1, T2 *t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (const char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare (bool const &t1, int const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare< char > (const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
bool | qCompare< char > (char *t1, char *t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
Q_TESTLIB_EXPORT bool | qCompare< double > (double const &t1, double const &t2, const char *actual, const char *expected, const char *file, int line) |
template<> | |
Q_TESTLIB_EXPORT bool | qCompare< float > (float const &t1, float const &t2, const char *actual, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT void * | qData (const char *tagName, int typeId) |
Q_TESTLIB_EXPORT void * | qElementData (const char *elementName, int metaTypeId) |
Q_TESTLIB_EXPORT int | qExec (QObject *testObject, int argc=0, char **argv=0) |
Executes tests declared in testObject. More... | |
Q_TESTLIB_EXPORT int | qExec (QObject *testObject, const QStringList &arguments) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Q_TESTLIB_EXPORT bool | qExpectFail (const char *dataIndex, const char *comment, TestFailMode mode, const char *file, int line) |
Q_TESTLIB_EXPORT void | qFail (const char *statementStr, const char *file, int line) |
Q_TESTLIB_EXPORT void * | qGlobalData (const char *tagName, int typeId) |
static bool | qInvokeTestMethod (const char *slotName, const char *data=0) |
Call init(), slot_data(), slot(), slot(), slot(). More... | |
static void | qInvokeTestMethodDataEntry (char *slot) |
static void | qInvokeTestMethods (QObject *testObject) |
QBenchmarkResult | qMedian (const QList< QBenchmarkResult > &container) |
static void | qPrintDataTags () |
static void | qPrintMessage (const QByteArray &ba) |
static void | qPrintTestSlots () |
static void | qSignalDumperCallback (QObject *caller, int method_index, void **argv) |
static void | qSignalDumperCallbackEndSignal (QObject *caller, int) |
static void | qSignalDumperCallbackSlot (QObject *caller, int method_index, void **argv) |
Q_TESTLIB_EXPORT void | qSkip (const char *message, SkipMode mode, const char *file, int line) |
Q_TESTLIB_EXPORT void | qSleep (int ms) |
Sleeps for ms milliseconds, blocking execution of the test. More... | |
int | qt_asprintf (QTestCharBuffer *str, const char *format,...) |
int Q_TESTLIB_EXPORT | qt_snprintf (char *str, int size, const char *format,...) |
template<class T > | |
bool | qTest (const T &actual, const char *elementName, const char *actualStr, const char *expected, const char *file, int line) |
Q_TESTLIB_EXPORT void | qtest_qParseArgs (int argc, char *argv[], bool qml) |
int | qTestRandomSeed () |
static int | qToInt (char *str) |
Q_TESTLIB_EXPORT bool | qVerify (bool statement, const char *statementStr, const char *description, const char *file, int line) |
static void | qWait (int ms) |
Waits for ms milliseconds. More... | |
static bool | qWaitForWindowShown (QWidget *window) |
Q_TESTLIB_EXPORT void | qWarn (const char *message) |
template<typename T > | |
static void | randomizeList (T *array, int size) |
void | seedRandom () |
static void | sendKeyEvent (KeyAction action, QWidget *widget, Qt::Key code, QString text, Qt::KeyboardModifiers modifier, int delay=-1) |
static void | sendKeyEvent (KeyAction action, QWidget *widget, Qt::Key code, char ascii, Qt::KeyboardModifiers modifier, int delay=-1) |
void Q_TESTLIB_EXPORT | setBenchmarkResult (qreal result, QBenchmarkMetric metric) |
Sets the benchmark result for this test function to result. More... | |
void | setIterationCount (int count) |
void | setIterationCountHint (int count) |
static void | simulateEvent (QWidget *widget, bool press, int code, Qt::KeyboardModifiers modifier, QString text, bool repeat, int delay=-1) |
template<typename T > | |
void | swap (T *array, int pos, int otherPos) |
Q_TESTLIB_EXPORT QObject * | testObject () |
char * | toHexRepresentation (const char *ba, int length) |
Returns a pointer to a string that is the string ba represented as a space-separated sequence of hex characters. More... | |
template<> | |
char * | toString (const QLatin1String &str) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string. More... | |
template<> | |
char * | toString (const QString &str) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string. More... | |
template<> | |
char * | toString (const QByteArray &ba) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the byte array ba. More... | |
template<> | |
char * | toString (const QTime &time) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given time. More... | |
template<> | |
char * | toString (const QDate &date) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given date. More... | |
template<> | |
char * | toString (const QDateTime &dateTime) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the date and time specified by dateTime. More... | |
template<> | |
char * | toString (const QChar &c) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given character. More... | |
template<> | |
char * | toString (const QPoint &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point. More... | |
template<> | |
char * | toString (const QSize &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size. More... | |
template<typename T > | |
char * | toString (const T &) |
Returns a textual representation of value. More... | |
template<> | |
char * | toString (const QRect &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle. More... | |
template<> | |
char * | toString (const QPointF &p) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point. More... | |
Q_TESTLIB_EXPORT char * | toString (const char *) |
Q_TESTLIB_EXPORT char * | toString (const void *) |
template<> | |
char * | toString (const QSizeF &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size. More... | |
template<> | |
char * | toString (const QRectF &s) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle. More... | |
template<> | |
char * | toString (const QUrl &uri) |
template<> | |
char * | toString (const QVariant &v) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given variant. More... | |
QTouchEventSequence | touchEvent (QWidget *widget=0, QTouchEvent::DeviceType deviceType=QTouchEvent::TouchScreen) |
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget. More... | |
static const char * | xmlIncidentType2String (QAbstractTestLogger::IncidentTypes type) |
static const char * | xmlMessageType2String (QAbstractTestLogger::MessageTypes type) |
The QTest namespace contains all the functions and declarations that are related to the QTestLib tool.
Please refer to the QTestLib Manual documentation for information on how to write unit tests.
anonymous enum |
Enumerator | |
---|---|
IndentSpacesCount |
Definition at line 65 of file qsignaldumper.cpp.
This enum numbers the different tests.
Enumerator | |
---|---|
AI_Undefined | |
AI_Name | |
AI_Result | |
AI_Tests | |
AI_Failures | |
AI_Errors | |
AI_Type | |
AI_Description | |
AI_PropertyValue | |
AI_QTestVersion | |
AI_QtVersion | |
AI_File | |
AI_Line | |
AI_Metric | |
AI_Tag | |
AI_Value | |
AI_Iterations |
Definition at line 55 of file qtestelementattribute.h.
enum QTest::KeyAction |
This enum describes possible actions for key handling.
Enumerator | |
---|---|
Press | |
Release | |
Click |
Definition at line 68 of file qtestkeyboard.h.
The enum specifies the kinds of test log messages.
Enumerator | |
---|---|
LET_Undefined | |
LET_Property | |
LET_Properties | |
LET_Failure | |
LET_Error | |
LET_TestCase | |
LET_TestSuite | |
LET_Benchmark | |
LET_SystemError |
Definition at line 76 of file qtestelementattribute.h.
enum QTest::MouseAction |
This enum describes possible actions for mouse handling.
Enumerator | |
---|---|
MousePress | |
MouseRelease | |
MouseClick | |
MouseDClick | |
MouseMove |
Definition at line 69 of file qtestmouse.h.
This enum lists all the things that can be benchmarked.
Enumerator | |
---|---|
FramesPerSecond | |
BitsPerSecond | |
BytesPerSecond | |
WalltimeMilliseconds | |
CPUTicks | |
InstructionReads | |
Events |
Definition at line 55 of file qbenchmarkmetric.h.
enum QTest::SkipMode |
This enum describes the modes for skipping tests during execution of the test data.
Enumerator | |
---|---|
SkipSingle | |
SkipAll |
Definition at line 82 of file qtest_global.h.
enum QTest::TestFailMode |
This enum describes the modes for handling an expected failure of the QVERIFY() or QCOMPARE() macros.
Enumerator | |
---|---|
Abort | |
Continue |
Definition at line 83 of file qtest_global.h.
|
inline |
Adds a column with type T
to the current test data.
name is the name of the column. dummy is a workaround for buggy compilers and can be ignored.
To populate the column with values, newRow() can be used. Use QFETCH() to fetch the data in the actual test.
Example:
To add custom types to the testdata, the type must be registered with QMetaType via Q_DECLARE_METATYPE() .
Note: This macro can only be used in a test's data function that is invoked by the test framework.
See Chapter 2: Data Driven Testing for a more extensive example.
Definition at line 168 of file qtestcase.h.
void QTest::addColumnInternal | ( | int | id, |
const char * | name | ||
) |
Definition at line 2160 of file qtestcase.cpp.
Referenced by addColumn(), and toString().
Qt::Key QTest::asciiToKey | ( | char | ascii | ) |
Convert an ascii char key value to a Qt Key value.
If the key is unknown a 0 is returned.
Note: this may happen more than you like since not all known ascii keys are converted already. So feel free to add all the keys you need.
Definition at line 57 of file qasciikey.cpp.
Referenced by keyEvent(), and toString().
void QTest::beginBenchmarkMeasurement | ( | ) |
Definition at line 260 of file qbenchmark.cpp.
Referenced by QTest::QBenchmarkIterationController::QBenchmarkIterationController().
const char* QTest::benchmarkMetricName | ( | QBenchmarkMetric | metric | ) |
Referenced by QXmlTestLogger::addBenchmarkResult(), and QTestLogger::addBenchmarkResult().
const char* QTest::benchmarkMetricUnit | ( | QBenchmarkMetric | metric | ) |
Referenced by printBenchmarkResult().
|
static |
Definition at line 125 of file qplaintestlogger.cpp.
Referenced by printBenchmarkResult().
|
static |
Definition at line 189 of file qxmltestlogger.cpp.
Referenced by QXmlTestLogger::addBenchmarkResult().
bool QTest::compare_helper | ( | bool | success, |
const char * | msg, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2290 of file qtestcase.cpp.
Referenced by compare_ptr_helper(), compare_string_helper(), qCompare(), qCompare< double >(), qCompare< float >(), and toString().
bool QTest::compare_helper | ( | bool | success, |
const char * | msg, | ||
char * | val1, | ||
char * | val2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2297 of file qtestcase.cpp.
|
inline |
Definition at line 193 of file qtestcase.h.
Referenced by qCompare().
bool QTest::compare_string_helper | ( | const char * | t1, |
const char * | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2376 of file qtestcase.cpp.
Referenced by compare_ptr_helper(), qCompare(), and qCompare< char >().
|
static |
const char * QTest::currentAppName | ( | ) |
Returns the name of the binary that is currently executed.
Definition at line 2218 of file qtestcase.cpp.
const char * QTest::currentDataTag | ( | ) |
Returns the name of the current test data.
If the test doesn't have any assigned testdata, the function returns 0.
Definition at line 2239 of file qtestcase.cpp.
Referenced by toString().
bool QTest::currentTestFailed | ( | ) |
Returns true if the current test function failed, otherwise false.
Definition at line 2247 of file qtestcase.cpp.
Referenced by qInvokeTestMethods(), and toString().
const char * QTest::currentTestFunction | ( | ) |
Returns the name of the test function that is currently executed.
Example:
Definition at line 2230 of file qtestcase.cpp.
Referenced by toString().
int QTest::defaultEventDelay | ( | ) |
Definition at line 997 of file qtestcase.cpp.
Referenced by defaultKeyDelay(), and defaultMouseDelay().
int Q_TESTLIB_EXPORT QTest::defaultKeyDelay | ( | ) |
Definition at line 1019 of file qtestcase.cpp.
Referenced by simulateEvent().
bool Q_TESTLIB_EXPORT QTest::defaultKeyVerbose | ( | ) |
Definition at line 989 of file qtestcase.cpp.
int Q_TESTLIB_EXPORT QTest::defaultMouseDelay | ( | ) |
Definition at line 1008 of file qtestcase.cpp.
Referenced by mouseEvent().
quint64 QTest::endBenchmarkMeasurement | ( | ) |
Definition at line 268 of file qbenchmark.cpp.
Referenced by QTest::QBenchmarkIterationController::~QBenchmarkIterationController().
void* QTest::fetchData | ( | QTestData * | data, |
const char * | tagName, | ||
int | typeId | ||
) |
Definition at line 1635 of file qtestcase.cpp.
Referenced by QXmlInputSource::next(), qData(), and qGlobalData().
void QTest::filter_unprintable | ( | char * | str | ) |
Definition at line 949 of file qtestcase.cpp.
Referenced by qt_asprintf(), qt_snprintf(), and QAbstractTestLogger::stopLogging().
QString QTest::formatResult | ( | T | number, |
int | significantDigits | ||
) |
Definition at line 250 of file qplaintestlogger.cpp.
Referenced by formatResult(), and printBenchmarkResult().
int QTest::formatResult | ( | char * | buffer, |
int | bufferSize, | ||
T | number, | ||
int | significantDigits | ||
) |
Definition at line 309 of file qplaintestlogger.cpp.
|
static |
void QTest::ignoreMessage | ( | QtMsgType | type, |
const char * | message | ||
) |
Ignores messages created by qDebug() or qWarning().
If the message with the corresponding type is outputted, it will be removed from the test log. If the test finished and the message was not outputted, a test failure is appended to the test log.
Note: Invoking this function will only ignore one message. If the message you want to ignore is outputted twice, you have to call ignoreMessage() twice, too.
Example:
The example above tests that QDir::mkdir() outputs the right warning when invoked with an invalid file name.
Definition at line 2123 of file qtestcase.cpp.
Referenced by toString().
|
static |
|
static |
Definition at line 109 of file qplaintestlogger.cpp.
Referenced by QPlainTestLogger::addIncident().
void QTest::initLogger | ( | ) |
Definition at line 171 of file qtestlog.cpp.
Referenced by QTestLog::startLogging().
|
static |
Definition at line 979 of file qtestcase.cpp.
Referenced by QAccessibleInterface::backgroundColor(), QAccessibleInterface::foregroundColor(), QMetaObject::invokeMethod(), qInvokeTestMethod(), qInvokeTestMethodDataEntry(), qInvokeTestMethods(), qPrintDataTags(), QAccessibleInterface::supportedMethods(), and QAccessibleInterface::~QAccessibleInterface().
|
inlinestatic |
Definition at line 162 of file qxmltestlogger.cpp.
Referenced by QTimerInfoList::activateTimers(), QSvgStructureNode::addChild(), QPostEventList::addEvent(), QXmlTestLogger::addIncident(), QXmlTestLogger::addMessage(), QCopChannel::answer(), QSvgNode::appendStyleProperty(), QCoreApplication::applicationFilePath(), QPatternist::TypeChecker::applyFunctionConversion(), QAxWidget::clear(), QApplicationPrivate::closePopup(), QPainterPath::contains(), QString::count(), QPatternist::AbstractDuration::create(), QEglFSScreen::createAndSetPlatformContext(), QCoreApplicationPrivate::createEventDispatcher(), QThreadPrivate::createEventDispatcher(), createReadHandlerHelper(), QDeclarativeTypeData::dataReceived(), QETWidget::doDeferredMap(), QDeclarativeXmlQueryEngine::doSubQueryJob(), QTextLayout::draw(), QObject::dumpObjectInfo(), QAxBase::dynamicCallHelper(), QLinkedList< JSC::Identifier >::empty(), QList< QPostEvent >::empty(), QMap< int, QFrameInfo >::empty(), QHash< QExplicitlySharedDataPointer, QHash >::empty(), QLinkedList< JSC::Identifier >::endsWith(), QVector< QPoint >::endsWith(), QList< QPostEvent >::endsWith(), QProxyStylePrivate::ensureBaseStyle(), QNetworkDiskCache::expire(), QGestureManager::filterEventThroughContexts(), QContiguousCache< T >::first(), QLinkedList< JSC::Identifier >::first(), QVector< QPoint >::first(), QList< QPostEvent >::first(), QXcbWindowSurface::flush(), getFullPath(), QDockAreaLayout::getGrid(), if(), QDirectFBScreen::initDevice(), QAxBase::initialize(), QMacPasteboardMime::initialize(), QPainterPath::intersected(), QPainterPath::intersects(), QStateMachinePrivate::isAtomic(), QStateMachinePrivate::isCompound(), isEmptyHelper(), isNull(), QStyleSheetBorderData::isOpaque(), QIndexMapper::isValid(), QItemSelectionRange::isValid(), isValidUri(), isValidWildcardRestriction(), QPatternist::XsdSchemaHelper::isWildcardSubset(), QContiguousCache< T >::last(), QLinkedList< JSC::Identifier >::last(), QVector< QPoint >::last(), QList< QPostEvent >::last(), launchWebBrowser(), QDialogButtonBoxPrivate::layoutButtons(), QPainterPath::length(), QIconLoader::loadIcon(), macVersion(), QDeclarativeText::mousePressEvent(), QAccessibleGroupBox::navigate(), QCFString::operator QString(), QSqlRecord::operator!=(), QProcessEnvironment::operator!=(), QRegExp::operator!=(), QList< QPostEvent >::operator+=(), QStringList::operator<<(), QPatternist::GeneralComparison::optimizationPasses(), QDeclarativeStyledText::parse(), QXmlSimpleReaderPrivate::parseContent(), QPatternist::XsdSchemaParser::parseNotation(), QPainterPath::percentAtLength(), QVector< QPoint >::pop_back(), QVector< QPoint >::pop_front(), QGLEngineSelector::preferredPaintEngine(), QSQLiteResult::prepare(), QPrinter::printRange(), QEventDispatcherQWS::processEvents(), QXmlSimpleReaderPrivate::processReference(), qax_noSuchFunction(), qDBusGenerateMetaObjectXml(), qDBusInterfaceFromMetaObject(), QEventDispatcherGlibPrivate::QEventDispatcherGlibPrivate(), QRect::QRect(), QRuntimeGraphicsSystem::QRuntimeGraphicsSystem(), qt_bitmapToRegion(), qt_region_strictContains(), qt_try_modal(), QETWidget::raiseOnClick(), QDeclarativeBindingCompilerPrivate::registerString(), QHash< QExplicitlySharedDataPointer, QHash >::remove(), QLinkedList< JSC::Identifier >::removeFirst(), QList< QPostEvent >::removeFirst(), QLinkedList< JSC::Identifier >::removeLast(), QList< QPostEvent >::removeLast(), QKqueueFileSystemWatcherEngine::removePaths(), QPatternist::ReportContext::resolveURI(), QFileDialog::restoreState(), QSqlRelationalTableModel::selectStatement(), QLineControl::setCursorBlinkPeriod(), QDockAreaLayout::setGrid(), QFileSystemModel::setRootPath(), QApplicationPrivate::setScreenTransformation(), QApplication::setStyle(), QLabel::setText(), QMdiSubWindow::setWidget(), QSidebar::showContextMenu(), QPainterPath::simplified(), someId(), QCommonStyle::standardPixmap(), QLinkedList< JSC::Identifier >::startsWith(), QVector< QPoint >::startsWith(), QList< QPostEvent >::startsWith(), QApplication::style(), QPainterPath::subtracted(), QRegion::swap(), QPainterPath::swap(), QUrl::swap(), QByteArray::swap(), QHash< QExplicitlySharedDataPointer, QHash >::take(), QAccessibleDial::text(), QLineControl::timerEvent(), QDeclarativeError::toString(), QPainterPath::united(), QTimerInfoList::unregisterTimers(), QListView::updateGeometries(), QWorkspaceChild::updateMask(), QGtkStyleUpdateScheduler::updateTheme(), QTestAccessibility::verifyEvent(), QApplicationPrivate::x11_apply_settings(), and QPatternist::yyparse().
|
static |
Definition at line 1067 of file qtestcase.cpp.
Referenced by qInvokeTestMethods(), qPrintDataTags(), qPrintTestSlots(), and qtest_qParseArgs().
int QTest::iterationCount | ( | ) |
Definition at line 238 of file qbenchmark.cpp.
Referenced by elapsed(), and QTest::QBenchmarkIterationController::isDone().
|
inlinestatic |
Definition at line 179 of file qtestkeyboard.h.
|
inlinestatic |
Definition at line 185 of file qtestkeyboard.h.
|
inlinestatic |
Simulates clicking a sequence of keys on a widget.
Optionally, a keyboard modifier can be specified as well as a delay (in milliseconds) of the test before each key click.
Example:
The example above simulates clicking the sequence of keys representing "hello world" on myWidget
without any keyboard modifiers and without delay of the test.
Definition at line 168 of file qtestkeyboard.h.
Referenced by QTestEvent::~QTestEvent().
|
inlinestatic |
Definition at line 161 of file qtestkeyboard.h.
Referenced by QCalendarPopup::event(), QMdiArea::eventFilter(), QBBInputContext::handleKeyboardEvent(), QVNCServer::hasClientCursor(), QmlJSDebugger::AbstractTool::inspector(), keyClick(), keyClicks(), keyPress(), keyRelease(), qt_dispatchKeyEvent(), qtKey2CocoaKey(), QVNCServer::setCursor(), QmlJSDebugger::AbstractViewInspector::slowDownFactor(), and QTestEvent::~QTestEvent().
|
inlinestatic |
Definition at line 164 of file qtestkeyboard.h.
|
inlinestatic |
Definition at line 175 of file qtestkeyboard.h.
Referenced by QMdiArea::eventFilter().
|
inlinestatic |
Definition at line 181 of file qtestkeyboard.h.
|
inlinestatic |
Definition at line 177 of file qtestkeyboard.h.
|
inlinestatic |
Definition at line 183 of file qtestkeyboard.h.
char QTest::keyToAscii | ( | Qt::Key | key | ) |
Convert a Qt Key to an ascii char value.
If the Qt key is unknown a 0 is returned.
Note: this may happen more than you like since not all known Qt keys are converted already. So feel free to add all the keys you need.
Definition at line 245 of file qasciikey.cpp.
Referenced by keyEvent(), and toString().
|
static |
Definition at line 67 of file qsignaldumper.cpp.
Referenced by QDBusConnectionPrivate::activateCall(), qSignalDumperCallback(), and QDBusConnectionPrivate::relaySignal().
|
static |
|
static |
Definition at line 121 of file qtestlog.cpp.
Referenced by QScriptDebuggerConsoleCommandJob::QScriptDebuggerConsoleCommandJob(), and QTestLog::startLogging().
|
static |
Definition at line 131 of file qplaintestlogger.cpp.
Referenced by QPlainTestLogger::addMessage(), and QPlainTestLogger::enterTestFunction().
|
inline |
Simulates clicking a mouse button with an optional modifier on a widget.
The position of the click is defined by pos; the default position is the center of the widget. If delay is specified, the test will wait for the specified amount of milliseconds before pressing and before releasing the button.
Definition at line 135 of file qtestmouse.h.
|
inline |
Simulates double clicking a mouse button with an optional modifier on a widget.
The position of the click is defined by pos; the default position is the center of the widget. If delay is specified, the test will wait for the specified amount of milliseconds before each press and release.
Definition at line 138 of file qtestmouse.h.
|
static |
Definition at line 71 of file qtestmouse.h.
Referenced by QStatusBar::event(), QGraphicsScene::event(), QWidget::event(), QMdiSubWindow::eventFilter(), mouseClick(), mouseDClick(), QGraphicsView::mouseDoubleClickEvent(), mouseMove(), QGraphicsViewPrivate::mouseMoveEventHandler(), mousePress(), QGraphicsView::mousePressEvent(), mouseRelease(), QGraphicsView::mouseReleaseEvent(), QGraphicsItemPrivate::remapItemPos(), QDeclarativePathView::sendMouseEvent(), QDeclarativeMouseArea::sendMouseEvent(), QDeclarativeFlickable::sendMouseEvent(), QDeclarativePinchArea::sendMouseEvent(), QDeclarativeTextInputPrivate::sendMouseEventToInputContext(), QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(), and QTestEvent::~QTestEvent().
Moves the mouse pointer to a widget.
If pos is not specified, the mouse pointer moves to the center of the widget. If a delay (in milliseconds) is given, the test will wait before moving the mouse pointer.
Definition at line 141 of file qtestmouse.h.
|
inline |
Simulates pressing a mouse button with an optional modifier on a widget.
The position is defined by pos; the default position is the center of the widget. If delay is specified, the test will wait for the specified amount of milliseconds before the press.
Definition at line 129 of file qtestmouse.h.
|
inline |
Simulates releasing a mouse button with an optional modifier on a widget.
The position of the release is defined by pos; the default position is the center of the widget. If delay is specified, the test will wait for the specified amount of milliseconds before releasing the button.
Definition at line 132 of file qtestmouse.h.
QTestData & QTest::newRow | ( | const char * | dataTag | ) |
Appends a new row to the current test data.
dataTag is the name of the testdata that will appear in the test output. Returns a QTestData reference that can be used to stream in data.
Example:
Note: This macro can only be used in a test's data function that is invoked by the test framework.
See Chapter 2: Data Driven Testing a more extensive example.
Definition at line 2183 of file qtestcase.cpp.
Referenced by addColumn(), QListModel::ensureSorted(), QTreeModel::ensureSorted(), QTableModel::ensureSorted(), QTextControlPrivate::gotoNextTableCell(), QTextControlPrivate::gotoPreviousTableCell(), QAbstractItemView::keyboardSearch(), QTableView::moveCursor(), and QTableModel::updateRowIndexes().
|
static |
Definition at line 157 of file qplaintestlogger.cpp.
Referenced by printBenchmarkResult(), printMessage(), QPlainTestLogger::startLogging(), and QPlainTestLogger::stopLogging().
|
static |
Definition at line 318 of file qplaintestlogger.cpp.
Referenced by QPlainTestLogger::addBenchmarkResult().
|
static |
Definition at line 198 of file qplaintestlogger.cpp.
Referenced by QPlainTestLogger::addIncident(), QPlainTestLogger::addMessage(), and QPlainTestLogger::enterTestFunction().
|
inline |
Definition at line 78 of file qtest_gui.h.
|
inline |
Definition at line 87 of file qtest_gui.h.
|
inline |
Definition at line 175 of file qtestcase.h.
|
inline |
Definition at line 177 of file qtest.h.
Referenced by compare_ptr_helper(), qCompare(), qCompare< char >(), and qTest().
|
inline |
|
inline |
Definition at line 192 of file qtest.h.
|
inline |
Definition at line 218 of file qtest.h.
bool QTest::qCompare | ( | T1 const & | , |
T2 const & | , | ||
const char * | , | ||
const char * | , | ||
const char * | , | ||
int | |||
) |
|
inline |
Definition at line 225 of file qtest.h.
|
inline |
Definition at line 258 of file qtestcase.h.
|
inline |
Definition at line 264 of file qtestcase.h.
|
inline |
Definition at line 271 of file qtestcase.h.
|
inline |
Definition at line 277 of file qtestcase.h.
|
inline |
Definition at line 337 of file qtestcase.h.
|
inline |
Definition at line 345 of file qtestcase.h.
|
inline |
Definition at line 355 of file qtestcase.h.
|
inline |
Definition at line 284 of file qtestcase.h.
|
inline |
Definition at line 290 of file qtestcase.h.
Q_TESTLIB_EXPORT bool QTest::qCompare< double > | ( | double const & | t1, |
double const & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2320 of file qtestcase.cpp.
Referenced by qCompare().
Q_TESTLIB_EXPORT bool QTest::qCompare< float > | ( | float const & | t1, |
float const & | t2, | ||
const char * | actual, | ||
const char * | expected, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2307 of file qtestcase.cpp.
Referenced by compare_ptr_helper(), qCompare(), and qCompare< char >().
void * QTest::qData | ( | const char * | tagName, |
int | typeId | ||
) |
Definition at line 2130 of file qtestcase.cpp.
Referenced by toString().
void * QTest::qElementData | ( | const char * | tagName, |
int | metaTypeId | ||
) |
Definition at line 2144 of file qtestcase.cpp.
Referenced by qTest(), and toString().
int QTest::qExec | ( | QObject * | testObject, |
int | argc = 0 , |
||
char ** | argv = 0 |
||
) |
Executes tests declared in testObject.
In addition, the private slots initTestCase()
, cleanupTestCase()
, init()
and cleanup()
are executed if they exist. See Creating a Test for more details.
Optionally, the command line arguments argc and argv can be provided. For a list of recognized arguments, read QTestLib Command Line Arguments.
For stand-alone tests, the convenience macro QTEST_MAIN() can be used to declare a main method that parses the command line arguments and executes the tests.
Returns 0 if all tests passed. Returns a value other than 0 if tests failed or in case of unhandled exceptions. The return value from this function is also the exit code of the test application when the QTEST_MAIN() macro is used.
The following example will run all tests in MyFirstTestObject
and MySecondTestObject
:
Note: This function is not reentrant, only one test can run at a time. A test that was executed with qExec() can't run another test via qExec() and threads are not allowed to call qExec() simultaneously.
If you have programatically created the arguments, as opposed to getting them from the arguments in main()
, it is likely of interest to use QTest::qExec(QObject *, const QStringList &) since it is Unicode safe.
Definition at line 1913 of file qtestcase.cpp.
Referenced by qExec(), and toString().
int QTest::qExec | ( | QObject * | testObject, |
const QStringList & | arguments | ||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Behaves identically to qExec(QObject *, int, char**) but takes a QStringList of arguments instead of a char**
list.
Definition at line 2048 of file qtestcase.cpp.
bool QTest::qExpectFail | ( | const char * | dataIndex, |
const char * | comment, | ||
QTest::TestFailMode | mode, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2094 of file qtestcase.cpp.
Referenced by toString().
void QTest::qFail | ( | const char * | statementStr, |
const char * | file, | ||
int | line | ||
) |
Definition at line 2067 of file qtestcase.cpp.
Referenced by toString().
void * QTest::qGlobalData | ( | const char * | tagName, |
int | typeId | ||
) |
Definition at line 2137 of file qtestcase.cpp.
Referenced by toString().
|
static |
Call init(), slot_data(), slot(), slot(), slot().
.., cleanup() If data is set then it is the only test that is performed
If the function was successfully called, true is returned, otherwise false.
Definition at line 1540 of file qtestcase.cpp.
Referenced by qInvokeTestMethods().
|
static |
Definition at line 1463 of file qtestcase.cpp.
Referenced by qInvokeTestMethod().
|
static |
Definition at line 1724 of file qtestcase.cpp.
Referenced by qExec().
QBenchmarkResult QTest::qMedian | ( | const QList< QBenchmarkResult > & | container | ) |
Definition at line 1433 of file qtestcase.cpp.
Referenced by qInvokeTestMethodDataEntry().
|
static |
Definition at line 1100 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
inlinestatic |
Definition at line 57 of file qsignaldumper.cpp.
Referenced by qSignalDumperCallback(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 1091 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
static |
Definition at line 73 of file qsignaldumper.cpp.
Referenced by QSignalDumper::startDump().
|
static |
Definition at line 159 of file qsignaldumper.cpp.
Referenced by QSignalDumper::startDump().
|
static |
Definition at line 129 of file qsignaldumper.cpp.
Referenced by QSignalDumper::startDump().
void QTest::qSkip | ( | const char * | message, |
QTest::SkipMode | mode, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2083 of file qtestcase.cpp.
Referenced by toString().
void QTest::qSleep | ( | int | ms | ) |
Sleeps for ms milliseconds, blocking execution of the test.
qSleep() will not do any event processing and leave your test unresponsive. Network communication might time out while sleeping. Use qWait() to do non-blocking sleeping.
ms must be greater than 0.
Note: The qSleep() function calls either nanosleep()
on unix or Sleep()
on windows, so the accuracy of time spent in qSleep() depends on the operating system.
Example:
Definition at line 2269 of file qtestcase.cpp.
Referenced by qExec(), qWait(), and toString().
int QTest::qt_asprintf | ( | QTestCharBuffer * | str, |
const char * | format, | ||
... | |||
) |
Definition at line 129 of file qabstracttestlogger.cpp.
Referenced by QXmlTestLogger::addBenchmarkResult(), QXmlTestLogger::addIncident(), QXmlTestLogger::addMessage(), QTestLogger::addTag(), QXmlTestLogger::enterTestFunction(), QTestXunitStreamer::formatAfterAttributes(), QTestXunitStreamer::formatAttributes(), QTestLightXmlStreamer::formatBeforeAttributes(), QTestXunitStreamer::formatEnd(), QTestXmlStreamer::formatEnd(), QTestLightXmlStreamer::formatEnd(), QTestXunitStreamer::formatStart(), QTestXmlStreamer::formatStart(), QTestLightXmlStreamer::formatStart(), QTestLightXmlStreamer::output(), QTestXmlStreamer::output(), printMessage(), and QXmlTestLogger::startLogging().
int QTest::qt_snprintf | ( | char * | str, |
int | size, | ||
const char * | format, | ||
... | |||
) |
Definition at line 961 of file qtestcase.cpp.
Referenced by QTestLogger::addBenchmarkResult(), QTestLogger::addIncident(), QTestLogger::addMessage(), QTestResult::compare(), QTestLogger::enterTestFunction(), QTestFileLogger::init(), printBenchmarkResult(), QTestLog::printUnhandledIgnoreMessages(), qCompare(), qInvokeTestMethod(), qPrintDataTags(), qtest_qParseArgs(), QPlainTestLogger::startLogging(), QPlainTestLogger::stopLogging(), QTestLogger::stopLogging(), toString(), and QTestResult::verify().
|
inline |
Definition at line 363 of file qtestcase.h.
Q_TESTLIB_EXPORT void QTest::qtest_qParseArgs | ( | int | argc, |
char * | argv[], | ||
bool | qml | ||
) |
Definition at line 1170 of file qtestcase.cpp.
Referenced by qExec().
int QTest::qTestRandomSeed | ( | ) |
Definition at line 1044 of file qtestcase.cpp.
|
static |
bool QTest::qVerify | ( | bool | statement, |
const char * | statementStr, | ||
const char * | description, | ||
const char * | file, | ||
int | line | ||
) |
Definition at line 2074 of file qtestcase.cpp.
Referenced by toString().
|
inlinestatic |
Waits for ms milliseconds.
While waiting, events will be processed and your test will stay responsive to user interface events or network communication.
Example:
The code above will wait until the network server is responding for a maximum of about 12.5 seconds.
Definition at line 62 of file qtestsystem.h.
Referenced by mouseEvent(), qWaitForWindowShown(), QTestDelayEvent::simulate(), and simulateEvent().
|
inlinestatic |
Waits until the window is shown in the screen. This is mainly useful for asynchronous systems like X11, where a window will be mapped to screen some time after being asked to show itself on the screen. Returns true.
Example:
Definition at line 74 of file qtestsystem.h.
void QTest::qWarn | ( | const char * | message | ) |
Definition at line 2102 of file qtestcase.cpp.
Referenced by mouseEvent(), simulateEvent(), and toString().
|
static |
Definition at line 1059 of file qtestcase.cpp.
Referenced by qInvokeTestMethods().
void QTest::seedRandom | ( | ) |
Definition at line 1030 of file qtestcase.cpp.
Referenced by qExec().
|
static |
Definition at line 87 of file qtestkeyboard.h.
Referenced by keyEvent(), and sendKeyEvent().
|
static |
Definition at line 152 of file qtestkeyboard.h.
void QTest::setBenchmarkResult | ( | qreal | result, |
QTest::QBenchmarkMetric | metric | ||
) |
Sets the benchmark result for this test function to result.
Use this function if you want to report benchmark results without using the QBENCHMARK macro. Use metric to specify how QTestLib should interpret the results.
The context for the result will be the test function name and any data tag from the _data function. This function can only be called once in each test function, subsequent calls will replace the earlier reported results.
Note that the -iterations command line argument has no effect on test functions without the QBENCHMARK macro.
Definition at line 291 of file qbenchmark.cpp.
void QTest::setIterationCount | ( | int | count | ) |
Definition at line 252 of file qbenchmark.cpp.
void QTest::setIterationCountHint | ( | int | count | ) |
Definition at line 245 of file qbenchmark.cpp.
|
static |
Definition at line 70 of file qtestkeyboard.h.
Referenced by sendKeyEvent().
void QTest::swap | ( | T * | array, |
int | pos, | ||
int | otherPos | ||
) |
Definition at line 1051 of file qtestcase.cpp.
Referenced by randomizeList().
QObject * QTest::testObject | ( | ) |
Definition at line 2283 of file qtestcase.cpp.
Referenced by qExec(), and toString().
Q_TESTLIB_EXPORT char * QTest::toHexRepresentation | ( | const char * | ba, |
int | length | ||
) |
Returns a pointer to a string that is the string ba represented as a space-separated sequence of hex characters.
If the input is considered too long, it is truncated. A trucation is indicated in the returned string as an ellipsis at the end.
length is the length of the string ba.
Definition at line 1667 of file qtestcase.cpp.
Referenced by toString().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string.
Definition at line 73 of file qtest.h.
Referenced by compare_ptr_helper(), compare_string_helper(), qCompare< double >(), qCompare< float >(), qSignalDumperCallback(), and toString().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given string.
Definition at line 78 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the byte array ba.
Definition at line 83 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given time.
Definition at line 88 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given date.
Definition at line 95 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the date and time specified by dateTime.
Definition at line 102 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given character.
Definition at line 110 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point.
Definition at line 115 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size.
Definition at line 120 of file qtest.h.
|
inline |
Returns a textual representation of value.
This function is used by QCOMPARE() to output verbose information in case of a test failure.
You can add specializations of this function to your test to enable verbose output.
Note: The caller of toString() must delete the returned data using delete[]
. Your implementation should return a string created with new[]
or qstrdup().
Example:
The example above defines a toString() specialization for a class called MyPoint
. Whenever a comparison of two instances of MyPoint
fails, QCOMPARE() will call this function to output the contents of MyPoint
to the test log.
Definition at line 123 of file qtestcase.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle.
Definition at line 125 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given point.
Definition at line 130 of file qtest.h.
char * QTest::toString | ( | const char * | str | ) |
Definition at line 2357 of file qtestcase.cpp.
char * QTest::toString | ( | const void * | p | ) |
Definition at line 2367 of file qtestcase.cpp.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given size.
Definition at line 135 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given rectangle.
Definition at line 140 of file qtest.h.
|
inline |
Returns a textual representation of the given url.
Definition at line 145 of file qtest.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns a textual representation of the given variant.
Definition at line 150 of file qtest.h.
|
inline |
Creates and returns a QTouchEventSequence for the device deviceType to simulate events for widget.
When adding touch events to the sequence, widget will also be used to translate the position provided to screen coordinates, unless another widget is provided in the respective calls to press(), move() etc.
The touch events are committed to the event system when the destructor of the QTouchEventSequence is called (ie when the object returned runs out of scope).
Definition at line 141 of file qtesttouch.h.
Referenced by QWidget::event(), QApplication::notify(), QApplicationPrivate::translateRawTouchEvent(), and QGraphicsView::viewportEvent().
|
static |
|
static |
|
static |
Definition at line 72 of file qtestresult.cpp.
Referenced by QTestResult::currentAppName(), QTestResult::setCurrentAppName(), and toString().
|
static |
Definition at line 57 of file qtestresult.cpp.
Referenced by QTestResult::currentGlobalDataTag(), QTestResult::currentGlobalTestData(), QTestResult::reset(), and QTestResult::setCurrentGlobalTestData().
|
static |
Definition at line 56 of file qtestresult.cpp.
Referenced by QTestResult::currentDataTag(), QTestResult::currentTestData(), isExpectFailData(), QTestResult::reset(), and QTestResult::setCurrentTestData().
|
static |
Definition at line 58 of file qtestresult.cpp.
Referenced by QTestResult::currentTestFunction(), QTestResult::finishedCurrentTestFunction(), QTestResult::reset(), and QTestResult::setCurrentTestFunction().
|
static |
Definition at line 903 of file qtestcase.cpp.
Referenced by qExec(), qInvokeTestMethod(), qInvokeTestMethodDataEntry(), qPrintDataTags(), qPrintTestSlots(), qtest_qParseArgs(), and testObject().
|
static |
Definition at line 59 of file qtestresult.cpp.
Referenced by QTestResult::currentTestObjectName(), QTestResult::reset(), and QTestResult::setCurrentTestObject().
|
static |
Definition at line 61 of file qtestresult.cpp.
Referenced by QTestResult::addFailure(), QTestResult::currentTestFailed(), QTestResult::finishedCurrentTestFunction(), QTestResult::reset(), and QTestResult::setCurrentTestData().
|
static |
Definition at line 940 of file qtestcase.cpp.
Referenced by defaultEventDelay(), and qtest_qParseArgs().
|
static |
Definition at line 69 of file qtestresult.cpp.
Referenced by checkStatement(), clearExpectFail(), QTestResult::expectFail(), and QTestResult::reset().
|
static |
Definition at line 70 of file qtestresult.cpp.
Referenced by checkStatement(), clearExpectFail(), QTestResult::expectFail(), and QTestResult::reset().
|
static |
Definition at line 60 of file qtestresult.cpp.
Referenced by QTestResult::addFailure(), QTestResult::allDataPassed(), checkStatement(), QTestResult::finishedCurrentTestFunction(), QTestXmlStreamer::formatEnd(), QTestResult::reset(), QTestResult::setCurrentTestFunction(), and QTestResult::testFailed().
|
static |
Definition at line 65 of file qtestresult.cpp.
Referenced by QTestResult::addFailure(), checkStatement(), QTestResult::failCount(), and QTestResult::reset().
|
static |
Definition at line 88 of file qtestlog.cpp.
Referenced by initLogger(), and QTestLog::setFlushMode().
|
static |
Definition at line 64 of file qsignaldumper.cpp.
Referenced by qSignalDumperCallback(), qSignalDumperCallbackEndSignal(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 85 of file qtestlog.cpp.
Referenced by QTestLog::addIgnoreMessage(), handleIgnoredMessage(), QTestLog::leaveTestFunction(), QTestLog::printUnhandledIgnoreMessages(), and QTestLog::unhandledIgnoreMessages().
|
static |
Definition at line 63 of file qsignaldumper.cpp.
Referenced by qSignalDumperCallback(), qSignalDumperCallbackEndSignal(), and qSignalDumperCallbackSlot().
|
static |
Definition at line 938 of file qtestcase.cpp.
Referenced by defaultKeyDelay(), and qtest_qParseArgs().
|
static |
Definition at line 942 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
static |
Definition at line 63 of file qtestresult.cpp.
Referenced by QUnixPrintWidgetPrivate::_q_printerChanged(), QPatternist::XsdSchemaResolver::addAlternativeType(), QPatternist::XsdSchemaResolver::addAttributeType(), QPatternist::XsdSchemaResolver::addComplexBaseType(), QPatternist::XsdSchemaResolver::addElementType(), QPatternist::XsdSchemaResolver::addKeyReference(), QPatternist::XsdSchemaResolver::addSimpleListType(), QPatternist::XsdSchemaResolver::addSimpleRestrictionBase(), QPatternist::XsdSchemaResolver::addSimpleUnionTypes(), QPatternist::XsdSchemaResolver::addSubstitutionGroupAffiliation(), QGLShaderProgram::bindAttributeLocation(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::CastingPlatform(), QPatternist::XsdSchemaChecker::checkBasicCircularInheritances(), QPatternist::XsdSchemaChecker::checkBasicComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkBasicSimpleTypeConstraints(), QPatternist::XsdSchemaChecker::checkCircularInheritances(), QPatternist::XsdSchemaChecker::checkComplexTypeConstraints(), QPatternist::XsdSchemaChecker::checkInheritanceRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleDerivationRestrictions(), QPatternist::XsdSchemaChecker::checkSimpleTypeConstraints(), QPatternist::GenericPredicate::create(), QPatternist::XsdSchemaParser::currentSourceLocation(), QTestResult::currentTestLocation(), QGL2PaintEngineExPrivate::drawPixmapFragments(), extract_location(), QGLEngineSharedShaders::findProgramInCache(), QTestResult::finishedCurrentTestFunction(), QTestXmlStreamer::formatStart(), getLocations(), QPatternist::ColoringMessageHandler::handleMessage(), QPatternist::AccelTreeResourceLoader::load(), QPatternist::XsdValidatingInstanceReader::loadSchema(), QPatternist::CastingPlatform< UntypedAtomicConverter, true >::locateCaster(), QLibraryInfo::location(), QScriptNewBreakpointWidget::onOkClicked(), QEventDispatcherMacPrivate::postedEventsSourcePerformCallback(), qt_mac_constructQIconFromIconRef(), QGLMaskTextureCache::quadtreeClear(), QGLMaskTextureCache::quadtreeInsert(), QGLMaskTextureCache::quadtreeLocation(), QTestResult::reset(), QDeclarativeTypeData::resolveTypes(), QGLShaderProgram::setAttributeValue(), QTestResult::setCurrentTestFunction(), QTestResult::setCurrentTestLocation(), QPatternist::XsdReference::setSourceLocation(), QPatternist::XsdAttributeReference::setSourceLocation(), QPatternist::XsdSchemaChecker::sourceLocation(), QPatternist::XsdSchemaResolver::sourceLocation(), QPatternist::StaticContext::StaticContext(), QOpenGLPaintEnginePrivate::updateFragmentProgramData(), writeIncludeFile(), and QMenuPrivate::QMenuScroller::~QMenuScroller().
|
static |
Definition at line 87 of file qtestlog.cpp.
Referenced by initLogger(), QTestLog::logMode(), and QTestLog::setLogMode().
|
static |
Definition at line 90 of file qtestlog.cpp.
Referenced by messageHandler(), and QTestLog::setMaxWarnings().
|
static |
Definition at line 939 of file qtestcase.cpp.
Referenced by defaultMouseDelay(), and qtest_qParseArgs().
|
static |
Definition at line 946 of file qtestcase.cpp.
Referenced by qExec(), and qtest_qParseArgs().
|
static |
Definition at line 95 of file qtestlog.cpp.
Referenced by QTestLog::startLogging(), and QTestLog::stopLogging().
|
static |
Definition at line 93 of file qtestlog.cpp.
Referenced by QMacPrintEngine::begin(), QTestLog::outputFileName(), and QTestLog::redirectOutput().
|
static |
Definition at line 66 of file qtestresult.cpp.
Referenced by QTestResult::finishedCurrentTestFunction(), QTestResult::passCount(), and QTestResult::reset().
Q_TESTLIB_EXPORT bool QTest::printAvailableFunctions = false |
Definition at line 1086 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
Q_TESTLIB_EXPORT bool QTest::printAvailableTags = false |
Definition at line 1087 of file qtestcase.cpp.
Referenced by QTestLog::addPass(), QTestLog::enterTestFunction(), initLogger(), QTestLog::leaveTestFunction(), and qtest_qParseArgs().
|
static |
Definition at line 941 of file qtestcase.cpp.
Referenced by qExec(), qInvokeTestMethods(), and qtest_qParseArgs().
|
static |
Definition at line 943 of file qtestcase.cpp.
Referenced by qIntCast(), qInvokeTestMethods(), qtest_qParseArgs(), qTestRandomSeed(), QPlainTestLogger::registerRandomSeed(), QXmlTestLogger::registerRandomSeed(), QTestLogger::registerRandomSeed(), seedRandom(), and QAbstractTestLogger::~QAbstractTestLogger().
|
static |
Definition at line 944 of file qtestcase.cpp.
Referenced by qtest_qParseArgs(), qTestRandomSeed(), and seedRandom().
|
static |
Definition at line 62 of file qtestresult.cpp.
Referenced by QTestResult::finishedCurrentTestFunction(), QTestResult::setSkipCurrentTest(), and QTestResult::skipCurrentTest().
|
static |
Definition at line 67 of file qtestresult.cpp.
Referenced by QTestResult::addSkip(), QTestResult::reset(), and QTestResult::skipCount().
|
static |
Definition at line 56 of file qtestfilelogger.cpp.
|
static |
Definition at line 60 of file qabstracttestlogger.cpp.
Referenced by QFontDatabasePrivate::addFont(), QCopChannel::answer(), QTextStream::bin(), QTextStream::bom(), QTextStream::center(), QMacPasteboardMimeVCard::convertFromMime(), QTextStream::dec(), deflate(), QSvgPaintEngine::drawImage(), QSvgPaintEngine::drawPolygon(), QAbstractItemModel::dropMimeData(), QAbstractTableModel::dropMimeData(), QAbstractListModel::dropMimeData(), QStandardItemModel::dropMimeData(), QTextStream::fixed(), QTestFileLogger::flush(), QTextStream::flush(), QTextStream::forcepoint(), QTextStream::forcesign(), QTextStream::hex(), inflate(), QTestFileLogger::init(), QCss::Parser::init(), QTestBasicStreamer::isTtyOutput(), QAbstractTestLogger::isTtyOutput(), QStandardItemModelPrivate::itemFromIndex(), launchWebBrowser(), QTextStream::left(), QScriptDebuggerConsolePrivate::loadScriptedCommands(), QTextStream::lowercasebase(), QTextStream::lowercasedigits(), QDebug::maybeSpace(), QDeclarativeDebugTrace::messageReceived(), QAbstractItemModel::mimeData(), QStandardItemModel::mimeData(), QTextStream::noforcepoint(), QTextStream::noforcesign(), QTextStream::noshowbase(), QDebug::nospace(), QTextStream::oct(), QDebug::operator<<(), operator<<(), QLine::operator<<(), QLineF::operator<<(), QDebug::operator=(), QmlJSDebugger::operator>>(), operator>>(), QLine::operator>>(), QLineF::operator>>(), QTestBasicStreamer::outputString(), QAbstractTestLogger::outputString(), QDeclarativeDirParser::parse(), QDeclarativeScriptParser::parse(), qax_generateDocumentation(), QDebug::QDebug(), QPolygon::QPolygon(), QXmlInputSource::QXmlInputSource(), QTextStream::reset(), QWidget::restoreGeometry(), QSplitter::restoreState(), QFileDialog::restoreState(), QMainWindowLayoutState::restoreState(), QHeaderView::restoreState(), QMainWindow::restoreState(), QTextStream::right(), QWidget::saveGeometry(), QSplitter::saveState(), QFileDialog::saveState(), QHeaderView::saveState(), QMainWindow::saveState(), QTextStream::scientific(), QTextStream::showbase(), QAbstractItemModel::sibling(), QDebug::space(), QAbstractTestLogger::startLogging(), QTestBasicStreamer::startStreaming(), QAbstractTestLogger::stopLogging(), QTestBasicStreamer::stopStreaming(), QSettingsPrivate::stringToVariant(), QWSInputContext::translateIMEvent(), QSvgPaintEngine::updateState(), QTextStream::uppercasebase(), QTextStream::uppercasedigits(), QTextStream::ws(), QDebug::~QDebug(), and QTestFileLogger::~QTestFileLogger().
|
static |
Definition at line 60 of file qtestbasicstreamer.cpp.
|
static |
Referenced by qInvokeTestMethods(), and QTest::TestFuncCleanup::~TestFuncCleanup().
|
static |
Definition at line 923 of file qtestcase.cpp.
Referenced by qInvokeTestMethods(), and qtest_qParseArgs().
|
static |
Contains the list of test functions that was supplied on the command line, if any. Hence, if not empty, those functions should be run instead of all appearing in the test case.
Definition at line 922 of file qtestcase.cpp.
Referenced by QTest::TestFuncCleanup::cleanup(), qInvokeTestMethods(), and qtest_qParseArgs().
Q_TESTLIB_EXPORT QStringList QTest::testFunctions |
Definition at line 1088 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
static |
Definition at line 92 of file qtestlog.cpp.
Referenced by QTestLog::addBenchmarkResult(), QTestLog::addFail(), QTestLog::addPass(), QTestLog::addSkip(), QTestLog::addXFail(), QTestLog::addXPass(), QTestLog::enterTestFunction(), QTestLog::info(), initLogger(), QTestLog::leaveTestFunction(), messageHandler(), QTestLog::printUnhandledIgnoreMessages(), QTestLog::startLogging(), QTestLog::stopLogging(), and QTestLog::warn().
Q_TESTLIB_EXPORT QStringList QTest::testTags |
Definition at line 1089 of file qtestcase.cpp.
Referenced by qtest_qParseArgs().
|
static |
Definition at line 89 of file qtestlog.cpp.
Referenced by QTestLog::setVerboseLevel(), and QTestLog::verboseLevel().