summaryrefslogtreecommitdiffstats
path: root/src/testlib
diff options
context:
space:
mode:
authorDimitrios Apostolou <jimis@qt.io>2021-11-29 10:47:55 +0100
committerDimitrios Apostolou <jimis@qt.io>2021-12-17 07:03:26 +0100
commit725fc4da44d61472b99a625ba25c045140adb6fa (patch)
tree7e3e03b25f5a2397c8059016a0a94af6d5bb0169 /src/testlib
parentdf0351836e3c008bff4326e0e52e764399d328b0 (diff)
Properly indent qtestlib's XML output
Also regenerate the expected output for tst_selftests, to match new output. Changed one line source code in tst_seftests for the same purpose. Change-Id: I930ba4bb290568d6f67a8910a781725f01f08bf1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r--src/testlib/qxmltestlogger.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp
index 33bbf7c250..873e29bc2b 100644
--- a/src/testlib/qxmltestlogger.cpp
+++ b/src/testlib/qxmltestlogger.cpp
@@ -131,11 +131,11 @@ void QXmlTestLogger::startLogging()
QTestCharBuffer quotedBuild;
if (!QLibraryInfo::build() || xmlQuote(&quotedBuild, QLibraryInfo::build())) {
QTest::qt_asprintf(&buf,
- "<Environment>\n"
+ " <Environment>\n"
" <QtVersion>%s</QtVersion>\n"
" <QtBuild>%s</QtBuild>\n"
" <QTestVersion>" QTEST_VERSION_STR "</QTestVersion>\n"
- "</Environment>\n", qVersion(), quotedBuild.constData());
+ " </Environment>\n", qVersion(), quotedBuild.constData());
outputString(buf.constData());
}
}
@@ -144,7 +144,7 @@ void QXmlTestLogger::stopLogging()
{
QTestCharBuffer buf;
- QTest::qt_asprintf(&buf, "<Duration msecs=\"%s\"/>\n",
+ QTest::qt_asprintf(&buf, " <Duration msecs=\"%s\"/>\n",
QString::number(QTestLog::msecsTotalTime()).toUtf8().constData());
outputString(buf.constData());
if (xmlmode == QXmlTestLogger::Complete)
@@ -158,7 +158,7 @@ void QXmlTestLogger::enterTestFunction(const char *function)
QTestCharBuffer quotedFunction;
if (xmlQuote(&quotedFunction, function)) {
QTestCharBuffer buf;
- QTest::qt_asprintf(&buf, "<TestFunction name=\"%s\">\n", quotedFunction.constData());
+ QTest::qt_asprintf(&buf, " <TestFunction name=\"%s\">\n", quotedFunction.constData());
outputString(buf.constData());
} else {
// Unconditional end-tag => omitting the start tag is bad.
@@ -172,7 +172,7 @@ void QXmlTestLogger::leaveTestFunction()
QTestCharBuffer buf;
QTest::qt_asprintf(&buf,
" <Duration msecs=\"%s\"/>\n"
- "</TestFunction>\n",
+ " </TestFunction>\n",
QString::number(QTestLog::msecsFunctionTime()).toUtf8().constData());
outputString(buf.constData());
@@ -190,45 +190,45 @@ static const char *incidentFormatString(bool noDescription, bool noTag)
{
if (noDescription) {
return noTag
- ? "<Incident type=\"%s\" file=\"%s\" line=\"%d\" />\n"
- : "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
- " <DataTag><![CDATA[%s%s%s%s]]></DataTag>\n"
- "</Incident>\n";
+ ? " <Incident type=\"%s\" file=\"%s\" line=\"%d\" />\n"
+ : " <Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ " <DataTag><![CDATA[%s%s%s%s]]></DataTag>\n"
+ " </Incident>\n";
}
return noTag
- ? "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
- " <Description><![CDATA[%s%s%s%s]]></Description>\n"
- "</Incident>\n"
- : "<Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
- " <DataTag><![CDATA[%s%s%s]]></DataTag>\n"
- " <Description><![CDATA[%s]]></Description>\n"
- "</Incident>\n";
+ ? " <Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ " <Description><![CDATA[%s%s%s%s]]></Description>\n"
+ " </Incident>\n"
+ : " <Incident type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ " <DataTag><![CDATA[%s%s%s]]></DataTag>\n"
+ " <Description><![CDATA[%s]]></Description>\n"
+ " </Incident>\n";
}
static const char *benchmarkResultFormatString()
{
- return "<BenchmarkResult metric=\"%s\" tag=\"%s\" value=\"%.6g\" iterations=\"%d\" />\n";
+ return " <BenchmarkResult metric=\"%s\" tag=\"%s\" value=\"%.6g\" iterations=\"%d\" />\n";
}
static const char *messageFormatString(bool noDescription, bool noTag)
{
if (noDescription) {
if (noTag)
- return "<Message type=\"%s\" file=\"%s\" line=\"%d\" />\n";
+ return " <Message type=\"%s\" file=\"%s\" line=\"%d\" />\n";
else
- return "<Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ return " <Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
" <DataTag><![CDATA[%s%s%s%s]]></DataTag>\n"
- "</Message>\n";
+ " </Message>\n";
} else {
if (noTag)
- return "<Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ return " <Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
" <Description><![CDATA[%s%s%s%s]]></Description>\n"
- "</Message>\n";
+ " </Message>\n";
else
- return "<Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
+ return " <Message type=\"%s\" file=\"%s\" line=\"%d\">\n"
" <DataTag><![CDATA[%s%s%s]]></DataTag>\n"
" <Description><![CDATA[%s]]></Description>\n"
- "</Message>\n";
+ " </Message>\n";
}
}