diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-04-16 05:29:08 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2010-04-19 07:31:22 (GMT) |
commit | cf2996cceb1ee07d8969867981c8caeabf2d35c3 (patch) | |
tree | aa205394766a6c9e979e650f461979252aec61dd /src/testlib/qtestxmlstreamer.cpp | |
parent | 47fc8188c76cf4f2d2cec7155c8293c634f6c653 (diff) | |
download | Qt-cf2996cceb1ee07d8969867981c8caeabf2d35c3.zip Qt-cf2996cceb1ee07d8969867981c8caeabf2d35c3.tar.gz Qt-cf2996cceb1ee07d8969867981c8caeabf2d35c3.tar.bz2 |
Fixed DataTag missing from testlib XML in some cases.
Task-number: QTBUG-6320
Diffstat (limited to 'src/testlib/qtestxmlstreamer.cpp')
-rw-r--r-- | src/testlib/qtestxmlstreamer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp index a44ea50..f63c221 100644 --- a/src/testlib/qtestxmlstreamer.cpp +++ b/src/testlib/qtestxmlstreamer.cpp @@ -111,12 +111,20 @@ 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", + QTestCharBuffer tagbuf; + if (element->attribute(QTest::AI_Tag)) { + QTestCharBuffer cdataTag; + QXmlTestLogger::xmlCdata(&cdataTag, element->attributeValue(QTest::AI_Tag)); + QTest::qt_asprintf(&tagbuf, " <DataTag><![CDATA[%s]]></DataTag>\n", cdataTag.constData()); + } + + QTest::qt_asprintf(formatted, "<Message type=\"%s\" %s=\"%s\" %s=\"%s\">\n%s <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), + tagbuf.constData(), cdataDesc.constData()); break; } |