diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 04:41:00 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-16 04:41:00 (GMT) |
commit | 348d1f6d421a6e23b769af99608fa6d81631a6c3 (patch) | |
tree | 012153ee6e575a240b74756278b725c476e04b29 /src/testlib | |
parent | 9ec14dcfa1d53b209e7a34b6163aac876771751e (diff) | |
download | Qt-348d1f6d421a6e23b769af99608fa6d81631a6c3.zip Qt-348d1f6d421a6e23b769af99608fa6d81631a6c3.tar.gz Qt-348d1f6d421a6e23b769af99608fa6d81631a6c3.tar.bz2 |
Throw exceptions on programming errors for global functions.
Task-number: QTBUG-7897
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qtestlightxmlstreamer.cpp | 3 | ||||
-rw-r--r-- | src/testlib/qtestlogger.cpp | 3 | ||||
-rw-r--r-- | src/testlib/qtestxmlstreamer.cpp | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/testlib/qtestlightxmlstreamer.cpp b/src/testlib/qtestlightxmlstreamer.cpp index 0ac9ea8..8c22a4f 100644 --- a/src/testlib/qtestlightxmlstreamer.cpp +++ b/src/testlib/qtestlightxmlstreamer.cpp @@ -87,12 +87,13 @@ void QTestLightXmlStreamer::formatStart(const QTestElement *element, QTestCharBu QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n", + QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <DataTag>%s</DataTag><Description><![CDATA[%s]]></Description>\n</Message>\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), + element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } diff --git a/src/testlib/qtestlogger.cpp b/src/testlib/qtestlogger.cpp index 6c76388..79bb84c 100644 --- a/src/testlib/qtestlogger.cpp +++ b/src/testlib/qtestlogger.cpp @@ -318,6 +318,9 @@ void QTestLogger::addMessage(MessageTypes type, const char *message, const char break; } + const char *tag = QTestResult::currentDataTag(); + if (tag) + errorElement->addAttribute(QTest::AI_Tag, tag); errorElement->addAttribute(QTest::AI_Type, typeBuf); errorElement->addAttribute(QTest::AI_Description, message); diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index b9946e5..9addb31 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -111,12 +111,13 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer QXmlTestLogger::xmlQuote("edFile, element->attributeValue(QTest::AI_File)); QXmlTestLogger::xmlCdata(&cdataDesc, element->attributeValue(QTest::AI_Description)); - QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <Description><![CDATA[%s]]></Description>\n</Message>\n", + QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n <DataTag>%s</DataTag>\n <Description><![CDATA[%s]]></Description>\n</Message>\n", element->attributeValue(QTest::AI_Type), element->attributeName(QTest::AI_File), quotedFile.constData(), element->attributeName(QTest::AI_Line), element->attributeValue(QTest::AI_Line), + element->attributeValue(QTest::AI_Tag) ? element->attributeValue(QTest::AI_Tag) : "", cdataDesc.constData()); break; } |