QBenchmarkGlobalData:current is created at the beginning of qExec()
and cleared at the end.
*/
-class Q_TEST_EXPORT QBenchmarkGlobalData
+class QBenchmarkGlobalData
{
public:
static QBenchmarkGlobalData *current;
created at the beginning of qInvokeTestMethod() and cleared at
the end.
*/
-class Q_TEST_EXPORT QBenchmarkTestMethodData
+class QBenchmarkTestMethodData
{
public:
static QBenchmarkTestMethodData *current;
class QTestLogger;
struct QTestCharBuffer;
-class QTestBasicStreamer
+class Q_TEST_EXPORT QTestBasicStreamer
{
public:
QTestBasicStreamer();
QT_BEGIN_NAMESPACE
template <class ElementType>
-class QTestCoreElement: public QTestCoreList<ElementType>
+class Q_TEST_EXPORT QTestCoreElement: public QTestCoreList<ElementType>
{
- public:
- QTestCoreElement( int type = -1 );
- virtual ~QTestCoreElement();
-
- void addAttribute(const QTest::AttributeIndex index, const char *value);
- QTestElementAttribute *attributes() const;
- const char *attributeValue(QTest::AttributeIndex index) const;
- const char *attributeName(QTest::AttributeIndex index) const;
- const QTestElementAttribute *attribute(QTest::AttributeIndex index) const;
-
- const char *elementName() const;
- QTest::LogElementType elementType() const;
-
- private:
- QTestElementAttribute *listOfAttributes;
- QTest::LogElementType type;
+public:
+ QTestCoreElement( int type = -1 );
+ virtual ~QTestCoreElement();
+
+ void addAttribute(const QTest::AttributeIndex index, const char *value);
+ QTestElementAttribute *attributes() const;
+ const char *attributeValue(QTest::AttributeIndex index) const;
+ const char *attributeName(QTest::AttributeIndex index) const;
+ const QTestElementAttribute *attribute(QTest::AttributeIndex index) const;
+
+ const char *elementName() const;
+ QTest::LogElementType elementType() const;
+
+private:
+ QTestElementAttribute *listOfAttributes;
+ QTest::LogElementType type;
};
template<class ElementType>
QTestCoreElement<ElementType>::QTestCoreElement(int t)
- :listOfAttributes(0), type(QTest::LogElementType(t))
+ : listOfAttributes(0), type(QTest::LogElementType(t))
{
}
QT_BEGIN_NAMESPACE
template <class T>
-class QTestCoreList
+class Q_TEST_EXPORT QTestCoreList
{
- public:
- QTestCoreList();
- virtual ~QTestCoreList();
-
- void addToList(T **list);
- T *nextElement();
- T *previousElement();
- int count(T *list);
- int count();
-
- private:
- T *next;
- T *prev;
+public:
+ QTestCoreList();
+ virtual ~QTestCoreList();
+
+ void addToList(T **list);
+ T *nextElement();
+ T *previousElement();
+ int count(T *list);
+ int count();
+
+private:
+ T *next;
+ T *prev;
};
template <class T>
QTestCoreList<T>::QTestCoreList()
-:next(0)
-,prev(0)
+ : next(0),
+ prev(0)
{
}
QT_BEGIN_NAMESPACE
-class QTestElement: public QTestCoreElement<QTestElement>
+class Q_TEST_EXPORT QTestElement: public QTestCoreElement<QTestElement>
{
- public:
- QTestElement(int type = -1);
- ~QTestElement();
+public:
+ QTestElement(int type = -1);
+ ~QTestElement();
- bool addLogElement(QTestElement *element);
- QTestElement *childElements() const;
+ bool addLogElement(QTestElement *element);
+ QTestElement *childElements() const;
- const QTestElement *parentElement() const;
- void setParent(const QTestElement *p);
-
- private:
- QTestElement *listOfChildren;
- const QTestElement * parent;
+ const QTestElement *parentElement() const;
+ void setParent(const QTestElement *p);
+private:
+ QTestElement *listOfChildren;
+ const QTestElement * parent;
};
QT_END_NAMESPACE
};
}
-class QTestElementAttribute: public QTestCoreList<QTestElementAttribute>
+class Q_TEST_EXPORT QTestElementAttribute: public QTestCoreList<QTestElementAttribute>
{
- public:
- QTestElementAttribute();
- ~QTestElementAttribute();
+public:
+ QTestElementAttribute();
+ ~QTestElementAttribute();
- const char *value() const;
- const char *name() const;
- QTest::AttributeIndex index() const;
- bool isNull() const;
- bool setPair(QTest::AttributeIndex attributeIndex, const char *value);
+ const char *value() const;
+ const char *name() const;
+ QTest::AttributeIndex index() const;
+ bool isNull() const;
+ bool setPair(QTest::AttributeIndex attributeIndex, const char *value);
- private:
- char *attributeValue;
- QTest::AttributeIndex attributeIndex;
+private:
+ char *attributeValue;
+ QTest::AttributeIndex attributeIndex;
};
QT_END_NAMESPACE
-
#endif
QT_BEGIN_NAMESPACE
-class QTestFileLogger
+class Q_TEST_EXPORT QTestFileLogger
{
public:
QTestFileLogger();
class QTestLogger : public QAbstractTestLogger
{
- public:
- enum TestLoggerFormat
- {
- TLF_XML = 0
- };
+public:
+ enum TestLoggerFormat
+ {
+ TLF_XML = 0
+ };
- QTestLogger(TestLoggerFormat fm = TestLoggerFormat::TLF_XML);
- ~QTestLogger();
+ QTestLogger(TestLoggerFormat fm = TestLoggerFormat::TLF_XML);
+ ~QTestLogger();
- void startLogging();
- void stopLogging();
+ void startLogging();
+ void stopLogging();
- void enterTestFunction(const char *function);
- void leaveTestFunction();
+ void enterTestFunction(const char *function);
+ void leaveTestFunction();
- void addIncident(IncidentTypes type, const char *description,
+ void addIncident(IncidentTypes type, const char *description,
const char *file = 0, int line = 0);
- void addBenchmarkResult(const QBenchmarkResult &result);
- void addTag(QTestElement* element);
+ void addBenchmarkResult(const QBenchmarkResult &result);
+ void addTag(QTestElement* element);
- void addMessage(MessageTypes type, const char *message,
+ void addMessage(MessageTypes type, const char *message,
const char *file = 0, int line = 0);
- void registerRandomSeed(unsigned int seed);
- unsigned int randomSeed() const;
- bool hasRandomSeed() const;
-
- private:
- QTestElement *listOfTestcases;
- QTestElement *currentLogElement;
- QTestElement *errorLogElement;
- QTestBasicStreamer *logFormatter;
- TestLoggerFormat format;
- QTestFileLogger *filelogger;
-
- int testCounter;
- int passCounter;
- int failureCounter;
- int errorCounter;
- int skipCounter;
- unsigned int randomSeed_;
- bool hasRandomSeed_;
+ void registerRandomSeed(unsigned int seed);
+ unsigned int randomSeed() const;
+ bool hasRandomSeed() const;
+
+private:
+ QTestElement *listOfTestcases;
+ QTestElement *currentLogElement;
+ QTestElement *errorLogElement;
+ QTestBasicStreamer *logFormatter;
+ TestLoggerFormat format;
+ QTestFileLogger *filelogger;
+
+ int testCounter;
+ int passCounter;
+ int failureCounter;
+ int errorCounter;
+ int skipCounter;
+ unsigned int randomSeed_;
+ bool hasRandomSeed_;
};
QT_END_NAMESPACE
class QTestResultPrivate;
class QTestData;
-class Q_TEST_EXPORT QTestResult
+class QTestResult
{
public:
enum TestLocation { NoWhere = 0, DataFunc = 1, InitFunc = 2, Func = 3, CleanupFunc = 4 };
class QTestData;
class QTestTablePrivate;
-class Q_TEST_EXPORT QTestTable
+class QTestTable
{
public:
QTestTable();
private:
Q_DISABLE_COPY(QTestTable)
-
QTestTablePrivate *d;
};
class QTestElement;
class QTestElementAttribute;
-class QTestXmlStreamer: public QTestBasicStreamer
+class Q_TEST_EXPORT QTestXmlStreamer: public QTestBasicStreamer
{
- public:
- QTestXmlStreamer();
- ~QTestXmlStreamer();
-
- void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
- void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
- void formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
- void output(QTestElement *element) const;
+public:
+ QTestXmlStreamer();
+ ~QTestXmlStreamer();
+
+ void formatStart(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatEnd(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void formatBeforeAttributes(const QTestElement *element, QTestCharBuffer *formatted) const;
+ void output(QTestElement *element) const;
};
QT_END_NAMESPACE