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>
bb10
Thiago Macieira 2012-05-02 14:49:31 +02:00 committed by Qt by Nokia
parent 693468a54d
commit fbabbe63c5
35 changed files with 36 additions and 36 deletions

View File

@ -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());
}

View File

@ -110,7 +110,7 @@ void QXmlTestLogger::startLogging()
QTestCharBuffer quotedTc;
xmlQuote(&quotedTc, 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(&quotedMetric,
benchmarkMetricName(result.metric));
xmlQuote(&quotedTag, result.context.tag.toAscii().constData());
xmlQuote(&quotedTag, result.context.tag.toUtf8().constData());
QTest::qt_asprintf(
&buf,

View File

@ -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];

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Assert">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_BadXml">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_BenchlibCounting">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_BenchlibEventCounter">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_BenchlibTickCounter">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_BenchlibWalltime">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Cmptest">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_DataTable">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Counting">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_DataTable">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_DateTime">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Exception">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_ExpectFail">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_FailCleanup">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_FailInit">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_FailInitData">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_FetchBogus">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="FindTestData">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_globaldata">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_LongString">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="MaxWarnings">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_SingleSkip">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Skip">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_SkipCleanup">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_SkipInit">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_SkipInitData">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_StrCmp">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Subtest">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Counting">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Counting">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Warnings">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<TestCase name="tst_Xunit">
<Environment>
<QtVersion>@INSERT_QT_VERSION_HERE@</QtVersion>