summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestxmlstreamer.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-04-16 15:29:08 +1000
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-04-19 17:31:22 +1000
commitcf2996cceb1ee07d8969867981c8caeabf2d35c3 (patch)
treeaa205394766a6c9e979e650f461979252aec61dd /src/testlib/qtestxmlstreamer.cpp
parent47fc8188c76cf4f2d2cec7155c8293c634f6c653 (diff)
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.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/testlib/qtestxmlstreamer.cpp b/src/testlib/qtestxmlstreamer.cpp
index a44ea50e18..f63c2216ca 100644
--- a/src/testlib/qtestxmlstreamer.cpp
+++ b/src/testlib/qtestxmlstreamer.cpp
@@ -111,12 +111,20 @@ void QTestXmlStreamer::formatStart(const QTestElement *element, QTestCharBuffer
QXmlTestLogger::xmlQuote(&quotedFile, 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;
}