Make the printing of complex Unicode in a QString prettier

This also has the advantage of not requiring the use of the locale
codec. Quite an advantage if you're debugging the locale codec. But it's
mostly so that we don't get question marks that hide the difference we
were trying to locate.

[ChangeLog][QtTest] QtTest now prints an escaped version of QStrings
that failed to compare with QCOMPARE. That is, instead of converting
non-printable characters to question marks, QtTest will print the
Unicode representation of the character in question.

Change-Id: I44c1ef3246b188c913dacd3ca4df02581356ea41
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Thiago Macieira 2014-01-20 16:03:30 -08:00 committed by The Qt Project
parent 19c7098251
commit 579526cfec
11 changed files with 146 additions and 85 deletions

View File

@ -66,14 +66,14 @@ QT_BEGIN_NAMESPACE
namespace QTest namespace QTest
{ {
template<> inline char *toString(const QLatin1String &str)
{
return qstrdup(qPrintable(QString(str)));
}
template<> inline char *toString(const QString &str) template<> inline char *toString(const QString &str)
{ {
return qstrdup(qPrintable(str)); return QTest::toPrettyUnicode(reinterpret_cast<const ushort *>(str.constData()), str.length());
}
template<> inline char *toString(const QLatin1String &str)
{
return toString(QString(str));
} }
template<> inline char *toString(const QByteArray &ba) template<> inline char *toString(const QByteArray &ba)
@ -195,15 +195,15 @@ inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual,
const int expectedSize = t2.count(); const int expectedSize = t2.count();
if (actualSize != expectedSize) { if (actualSize != expectedSize) {
qsnprintf(msg, sizeof(msg), "Compared lists have different sizes.\n" qsnprintf(msg, sizeof(msg), "Compared lists have different sizes.\n"
" Actual (%s) size: '%d'\n" " Actual (%s) size: %d\n"
" Expected (%s) size: '%d'", actual, actualSize, expected, expectedSize); " Expected (%s) size: %d", actual, actualSize, expected, expectedSize);
isOk = false; isOk = false;
} }
for (int i = 0; isOk && i < actualSize; ++i) { for (int i = 0; isOk && i < actualSize; ++i) {
if (!(t1.at(i) == t2.at(i))) { if (!(t1.at(i) == t2.at(i))) {
qsnprintf(msg, sizeof(msg), "Compared lists differ at index %d.\n" qsnprintf(msg, sizeof(msg), "Compared lists differ at index %d.\n"
" Actual (%s): '%s'\n" " Actual (%s): %s\n"
" Expected (%s): '%s'", i, actual, toString(t1.at(i)), " Expected (%s): %s", i, actual, toString(t1.at(i)),
expected, toString(t2.at(i))); expected, toString(t2.at(i)));
isOk = false; isOk = false;
} }

View File

@ -1894,6 +1894,12 @@ void *fetchData(QTestData *data, const char *tagName, int typeId)
return data->data(idx); return data->data(idx);
} }
static char toHex(ushort value)
{
static const char hexdigits[] = "0123456789ABCDEF";
return hexdigits[value & 0xF];
}
/*! /*!
\fn char* QTest::toHexRepresentation(const char *ba, int length) \fn char* QTest::toHexRepresentation(const char *ba, int length)
@ -1937,16 +1943,15 @@ char *toHexRepresentation(const char *ba, int length)
result[size - 1] = '\0'; result[size - 1] = '\0';
} }
const char toHex[] = "0123456789ABCDEF";
int i = 0; int i = 0;
int o = 0; int o = 0;
while (true) { while (true) {
const char at = ba[i]; const char at = ba[i];
result[o] = toHex[(at >> 4) & 0x0F]; result[o] = toHex(at >> 4);
++o; ++o;
result[o] = toHex[at & 0x0F]; result[o] = toHex(at);
++i; ++i;
++o; ++o;
@ -1961,6 +1966,61 @@ char *toHexRepresentation(const char *ba, int length)
return result; return result;
} }
/*!
\internal
Returns the same QString but with only the ASCII characters still shown;
everything else is replaced with \c {\uXXXX}.
*/
char *toPrettyUnicode(const ushort *p, int length)
{
// keep it simple for the vast majority of cases
QScopedArrayPointer<char> buffer(new char[length * 6 + 3]);
const ushort *end = p + length;
char *dst = buffer.data();
*dst++ = '"';
for ( ; p != end; ++p) {
if (*p < 0x7f && *p >= 0x20 && *p != '\\') {
*dst++ = *p;
continue;
}
// write as an escape sequence
*dst++ = '\\';
switch (*p) {
case 0x22:
case 0x5c:
*dst++ = uchar(*p);
break;
case 0x8:
*dst++ = 'b';
break;
case 0xc:
*dst++ = 'f';
break;
case 0xa:
*dst++ = 'n';
break;
case 0xd:
*dst++ = 'r';
break;
case 0x9:
*dst++ = 't';
break;
default:
*dst++ = 'u';
*dst++ = toHex(*p >> 12);
*dst++ = toHex(*p >> 8);
*dst++ = toHex(*p >> 4);
*dst++ = toHex(*p);
}
}
*dst++ = '"';
*dst++ = '\0';
return buffer.take();
}
static void qInvokeTestMethods(QObject *testObject) static void qInvokeTestMethods(QObject *testObject)
{ {
const QMetaObject *metaObject = testObject->metaObject(); const QMetaObject *metaObject = testObject->metaObject();

View File

@ -233,6 +233,7 @@ namespace QTest
Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length); Q_TESTLIB_EXPORT char *toHexRepresentation(const char *ba, int length);
Q_TESTLIB_EXPORT char *toPrettyUnicode(const ushort *unicode, int length);
Q_TESTLIB_EXPORT char *toString(const char *); Q_TESTLIB_EXPORT char *toString(const char *);
Q_TESTLIB_EXPORT char *toString(const void *); Q_TESTLIB_EXPORT char *toString(const void *);

View File

@ -54,48 +54,48 @@
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[last item different]]></DataTag> <DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS']]></Description> Expected (opB): "DIFFERS"]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[second-last item different]]></DataTag> <DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS']]></Description> Expected (opB): "DIFFERS"]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[prefix]]></DataTag> <DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '2' Actual (opA) size: 2
Expected (opB) size: '1']]></Description> Expected (opB) size: 1]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list second]]></DataTag> <DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '12' Actual (opA) size: 12
Expected (opB) size: '1']]></Description> Expected (opB) size: 1]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list first]]></DataTag> <DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '1' Actual (opA) size: 1
Expected (opB) size: '12']]></Description> Expected (opB) size: 12]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>
<TestFunction name="compareQListInt"> <TestFunction name="compareQListInt">
<Incident type="fail" file="tst_cmptest.cpp" line="320"> <Incident type="fail" file="tst_cmptest.cpp" line="320">
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (int1): '3' Actual (int1): 3
Expected (int2): '4']]></Description> Expected (int2): 4]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>
<TestFunction name="compareQListDouble"> <TestFunction name="compareQListDouble">
<Incident type="fail" file="tst_cmptest.cpp" line="327"> <Incident type="fail" file="tst_cmptest.cpp" line="327">
<Description><![CDATA[Compared lists differ at index 0. <Description><![CDATA[Compared lists differ at index 0.
Actual (double1): '1.5' Actual (double1): 1.5
Expected (double2): '1']]></Description> Expected (double2): 1]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>

View File

@ -23,32 +23,32 @@ FAIL! : tst_Cmptest::compare_tostring(both non-null user type) Compared values
PASS : tst_Cmptest::compareQStringLists(empty lists) PASS : tst_Cmptest::compareQStringLists(empty lists)
PASS : tst_Cmptest::compareQStringLists(equal lists) PASS : tst_Cmptest::compareQStringLists(equal lists)
FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2. FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS' Expected (opB): "DIFFERS"
Loc: [tst_cmptest.cpp(313)] Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2. FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS' Expected (opB): "DIFFERS"
Loc: [tst_cmptest.cpp(313)] Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes. FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes.
Actual (opA) size: '2' Actual (opA) size: 2
Expected (opB) size: '1' Expected (opB) size: 1
Loc: [tst_cmptest.cpp(313)] Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes. FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes.
Actual (opA) size: '12' Actual (opA) size: 12
Expected (opB) size: '1' Expected (opB) size: 1
Loc: [tst_cmptest.cpp(313)] Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes. FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes.
Actual (opA) size: '1' Actual (opA) size: 1
Expected (opB) size: '12' Expected (opB) size: 12
Loc: [tst_cmptest.cpp(313)] Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2. FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
Actual (int1): '3' Actual (int1): 3
Expected (int2): '4' Expected (int2): 4
Loc: [tst_cmptest.cpp(320)] Loc: [tst_cmptest.cpp(320)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0. FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
Actual (double1): '1.5' Actual (double1): 1.5
Expected (double2): '1' Expected (double2): 1
Loc: [tst_cmptest.cpp(327)] Loc: [tst_cmptest.cpp(327)]
PASS : tst_Cmptest::compareQPixmaps(both null) PASS : tst_Cmptest::compareQPixmaps(both null)
FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ. FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ.

View File

@ -56,48 +56,48 @@
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[last item different]]></DataTag> <DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS']]></Description> Expected (opB): "DIFFERS"]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[second-last item different]]></DataTag> <DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (opA): 'string3' Actual (opA): "string3"
Expected (opB): 'DIFFERS']]></Description> Expected (opB): "DIFFERS"]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[prefix]]></DataTag> <DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '2' Actual (opA) size: 2
Expected (opB) size: '1']]></Description> Expected (opB) size: 1]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list second]]></DataTag> <DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '12' Actual (opA) size: 12
Expected (opB) size: '1']]></Description> Expected (opB) size: 1]]></Description>
</Incident> </Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313"> <Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list first]]></DataTag> <DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes. <Description><![CDATA[Compared lists have different sizes.
Actual (opA) size: '1' Actual (opA) size: 1
Expected (opB) size: '12']]></Description> Expected (opB) size: 12]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>
<TestFunction name="compareQListInt"> <TestFunction name="compareQListInt">
<Incident type="fail" file="tst_cmptest.cpp" line="320"> <Incident type="fail" file="tst_cmptest.cpp" line="320">
<Description><![CDATA[Compared lists differ at index 2. <Description><![CDATA[Compared lists differ at index 2.
Actual (int1): '3' Actual (int1): 3
Expected (int2): '4']]></Description> Expected (int2): 4]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>
<TestFunction name="compareQListDouble"> <TestFunction name="compareQListDouble">
<Incident type="fail" file="tst_cmptest.cpp" line="327"> <Incident type="fail" file="tst_cmptest.cpp" line="327">
<Description><![CDATA[Compared lists differ at index 0. <Description><![CDATA[Compared lists differ at index 0.
Actual (double1): '1.5' Actual (double1): 1.5
Expected (double2): '1']]></Description> Expected (double2): 1]]></Description>
</Incident> </Incident>
<Duration msecs="0"/> <Duration msecs="0"/>
</TestFunction> </TestFunction>

View File

@ -23,30 +23,30 @@
</testcase> </testcase>
<testcase result="fail" name="compareQStringLists"> <testcase result="fail" name="compareQStringLists">
<failure tag="last item different" message="Compared lists differ at index 2. <failure tag="last item different" message="Compared lists differ at index 2.
Actual (opA): &apos;string3&apos; Actual (opA): &quot;string3&quot;
Expected (opB): &apos;DIFFERS&apos;" result="fail"/> Expected (opB): &quot;DIFFERS&quot;" result="fail"/>
<failure tag="second&#x002D;last item different" message="Compared lists differ at index 2. <failure tag="second&#x002D;last item different" message="Compared lists differ at index 2.
Actual (opA): &apos;string3&apos; Actual (opA): &quot;string3&quot;
Expected (opB): &apos;DIFFERS&apos;" result="fail"/> Expected (opB): &quot;DIFFERS&quot;" result="fail"/>
<failure tag="prefix" message="Compared lists have different sizes. <failure tag="prefix" message="Compared lists have different sizes.
Actual (opA) size: &apos;2&apos; Actual (opA) size: 2
Expected (opB) size: &apos;1&apos;" result="fail"/> Expected (opB) size: 1" result="fail"/>
<failure tag="short list second" message="Compared lists have different sizes. <failure tag="short list second" message="Compared lists have different sizes.
Actual (opA) size: &apos;12&apos; Actual (opA) size: 12
Expected (opB) size: &apos;1&apos;" result="fail"/> Expected (opB) size: 1" result="fail"/>
<failure tag="short list first" message="Compared lists have different sizes. <failure tag="short list first" message="Compared lists have different sizes.
Actual (opA) size: &apos;1&apos; Actual (opA) size: 1
Expected (opB) size: &apos;12&apos;" result="fail"/> Expected (opB) size: 12" result="fail"/>
</testcase> </testcase>
<testcase result="fail" name="compareQListInt"> <testcase result="fail" name="compareQListInt">
<failure message="Compared lists differ at index 2. <failure message="Compared lists differ at index 2.
Actual (int1): &apos;3&apos; Actual (int1): 3
Expected (int2): &apos;4&apos;" result="fail"/> Expected (int2): 4" result="fail"/>
</testcase> </testcase>
<testcase result="fail" name="compareQListDouble"> <testcase result="fail" name="compareQListDouble">
<failure message="Compared lists differ at index 0. <failure message="Compared lists differ at index 0.
Actual (double1): &apos;1.5&apos; Actual (double1): 1.5
Expected (double2): &apos;1&apos;" result="fail"/> Expected (double2): 1" result="fail"/>
</testcase> </testcase>
<testcase result="fail" name="compareQPixmaps"> <testcase result="fail" name="compareQPixmaps">
<failure tag="one null" message="Compared QPixmaps differ. <failure tag="one null" message="Compared QPixmaps differ.

View File

@ -125,8 +125,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154"> <Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data1]]></DataTag> <DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same <Description><![CDATA[Compared values are not the same
Actual (str) : hello1 Actual (str) : "hello1"
Expected (QString("hello0")): hello0]]></Description> Expected (QString("hello0")): "hello0"]]></Description>
</Incident> </Incident>
<Message type="qdebug" file="" line="0"> <Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data1]]></DataTag> <DataTag><![CDATA[data1]]></DataTag>
@ -143,8 +143,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154"> <Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data2]]></DataTag> <DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same <Description><![CDATA[Compared values are not the same
Actual (str) : hello2 Actual (str) : "hello2"
Expected (QString("hello0")): hello0]]></Description> Expected (QString("hello0")): "hello0"]]></Description>
</Incident> </Incident>
<Message type="qdebug" file="" line="0"> <Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag> <DataTag><![CDATA[data2]]></DataTag>

View File

@ -33,15 +33,15 @@ PASS : tst_Subtest::test3(data0)
QDEBUG : tst_Subtest::test3(data1) init test3 data1 QDEBUG : tst_Subtest::test3(data1) init test3 data1
QDEBUG : tst_Subtest::test3(data1) test2 test3 data1 QDEBUG : tst_Subtest::test3(data1) test2 test3 data1
FAIL! : tst_Subtest::test3(data1) Compared values are not the same FAIL! : tst_Subtest::test3(data1) Compared values are not the same
Actual (str) : hello1 Actual (str) : "hello1"
Expected (QString("hello0")): hello0 Expected (QString("hello0")): "hello0"
Loc: [tst_subtest.cpp(154)] Loc: [tst_subtest.cpp(154)]
QDEBUG : tst_Subtest::test3(data1) cleanup test3 data1 QDEBUG : tst_Subtest::test3(data1) cleanup test3 data1
QDEBUG : tst_Subtest::test3(data2) init test3 data2 QDEBUG : tst_Subtest::test3(data2) init test3 data2
QDEBUG : tst_Subtest::test3(data2) test2 test3 data2 QDEBUG : tst_Subtest::test3(data2) test2 test3 data2
FAIL! : tst_Subtest::test3(data2) Compared values are not the same FAIL! : tst_Subtest::test3(data2) Compared values are not the same
Actual (str) : hello2 Actual (str) : "hello2"
Expected (QString("hello0")): hello0 Expected (QString("hello0")): "hello0"
Loc: [tst_subtest.cpp(154)] Loc: [tst_subtest.cpp(154)]
QDEBUG : tst_Subtest::test3(data2) cleanup test3 data2 QDEBUG : tst_Subtest::test3(data2) cleanup test3 data2
QDEBUG : tst_Subtest::cleanupTestCase() cleanupTestCase cleanupTestCase (null) QDEBUG : tst_Subtest::cleanupTestCase() cleanupTestCase cleanupTestCase (null)

View File

@ -127,8 +127,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154"> <Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data1]]></DataTag> <DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same <Description><![CDATA[Compared values are not the same
Actual (str) : hello1 Actual (str) : "hello1"
Expected (QString("hello0")): hello0]]></Description> Expected (QString("hello0")): "hello0"]]></Description>
</Incident> </Incident>
<Message type="qdebug" file="" line="0"> <Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data1]]></DataTag> <DataTag><![CDATA[data1]]></DataTag>
@ -145,8 +145,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154"> <Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data2]]></DataTag> <DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same <Description><![CDATA[Compared values are not the same
Actual (str) : hello2 Actual (str) : "hello2"
Expected (QString("hello0")): hello0]]></Description> Expected (QString("hello0")): "hello0"]]></Description>
</Incident> </Incident>
<Message type="qdebug" file="" line="0"> <Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag> <DataTag><![CDATA[data2]]></DataTag>

View File

@ -38,14 +38,14 @@
<!-- tag="data1" message="init test3 data1" type="qdebug" --> <!-- tag="data1" message="init test3 data1" type="qdebug" -->
<!-- tag="data1" message="test2 test3 data1" type="qdebug" --> <!-- tag="data1" message="test2 test3 data1" type="qdebug" -->
<failure tag="data1" message="Compared values are not the same <failure tag="data1" message="Compared values are not the same
Actual (str) : hello1 Actual (str) : &quot;hello1&quot;
Expected (QString(&quot;hello0&quot;)): hello0" result="fail"/> Expected (QString(&quot;hello0&quot;)): &quot;hello0&quot;" result="fail"/>
<!-- tag="data1" message="cleanup test3 data1" type="qdebug" --> <!-- tag="data1" message="cleanup test3 data1" type="qdebug" -->
<!-- tag="data2" message="init test3 data2" type="qdebug" --> <!-- tag="data2" message="init test3 data2" type="qdebug" -->
<!-- tag="data2" message="test2 test3 data2" type="qdebug" --> <!-- tag="data2" message="test2 test3 data2" type="qdebug" -->
<failure tag="data2" message="Compared values are not the same <failure tag="data2" message="Compared values are not the same
Actual (str) : hello2 Actual (str) : &quot;hello2&quot;
Expected (QString(&quot;hello0&quot;)): hello0" result="fail"/> Expected (QString(&quot;hello0&quot;)): &quot;hello0&quot;" result="fail"/>
<!-- tag="data2" message="cleanup test3 data2" type="qdebug" --> <!-- tag="data2" message="cleanup test3 data2" type="qdebug" -->
</testcase> </testcase>
<testcase result="pass" name="cleanupTestCase"> <testcase result="pass" name="cleanupTestCase">