diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-05-02 14:49:31 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-09 10:45:01 +0200 |
commit | fbabbe63c5dcf688f38a7c9bf1bae63b19086935 (patch) | |
tree | d67ceadb22ec11b03b9d84ea1bd203fef831b2d5 /src | |
parent | 693468a54da02ff64b104bae8d3b419253889233 (diff) |
Use UTF-8 in the QtTest data and benchmark tags
Future-proofing. Since Qt source code is now mandated to be in UTF-8,
it is entirely possible that someone will use non-ASCII in data tags.
Though it would be interesting to see how to access them from the
Windows command-line.
Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/testlib/qplaintestlogger.cpp | 2 | ||||
-rw-r--r-- | src/testlib/qxmltestlogger.cpp | 4 | ||||
-rw-r--r-- | src/testlib/qxunittestlogger.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/testlib/qplaintestlogger.cpp b/src/testlib/qplaintestlogger.cpp index 8fd9e8b215..5a451b331d 100644 --- a/src/testlib/qplaintestlogger.cpp +++ b/src/testlib/qplaintestlogger.cpp @@ -264,7 +264,7 @@ void QPlainTestLogger::printBenchmarkResult(const QBenchmarkResult &result) char bufTag[1024]; bufTag[0] = 0; - QByteArray tag = result.context.tag.toAscii(); + QByteArray tag = result.context.tag.toLocal8Bit(); if (tag.isEmpty() == false) { qsnprintf(bufTag, sizeof(bufTag), ":\"%s\"", tag.data()); } diff --git a/src/testlib/qxmltestlogger.cpp b/src/testlib/qxmltestlogger.cpp index 7e5da20680..185cbc5c0a 100644 --- a/src/testlib/qxmltestlogger.cpp +++ b/src/testlib/qxmltestlogger.cpp @@ -110,7 +110,7 @@ void QXmlTestLogger::startLogging() QTestCharBuffer quotedTc; xmlQuote("edTc, QTestResult::currentTestObjectName()); QTest::qt_asprintf(&buf, - "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" + "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" "<TestCase name=\"%s\">\n", quotedTc.constData()); outputString(buf.constData()); } @@ -244,7 +244,7 @@ void QXmlTestLogger::addBenchmarkResult(const QBenchmarkResult &result) xmlQuote("edMetric, benchmarkMetricName(result.metric)); - xmlQuote("edTag, result.context.tag.toAscii().constData()); + xmlQuote("edTag, result.context.tag.toUtf8().constData()); QTest::qt_asprintf( &buf, diff --git a/src/testlib/qxunittestlogger.cpp b/src/testlib/qxunittestlogger.cpp index 5967ccdd4e..4eeb7a0e19 100644 --- a/src/testlib/qxunittestlogger.cpp +++ b/src/testlib/qxunittestlogger.cpp @@ -231,7 +231,7 @@ void QXunitTestLogger::addBenchmarkResult(const QBenchmarkResult &result) benchmarkElement->addAttribute( QTest::AI_Metric, QTest::benchmarkMetricName(QBenchmarkTestMethodData::current->result.metric)); - benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toAscii().data()); + benchmarkElement->addAttribute(QTest::AI_Tag, result.context.tag.toUtf8().data()); benchmarkElement->addAttribute(QTest::AI_Value, QByteArray::number(result.value).constData()); char buf[100]; |