summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-01-20 16:03:30 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-16 06:54:18 +0100
commit579526cfec082679241548a0fca1ff9ba2c350a7 (patch)
tree46062137fa4749fdc19793d13a4def2e4dab62d7 /tests
parent19c70982517e76d89bb3da931e1390a6386603da (diff)
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml28
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt28
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml28
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xunitxml28
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.xml8
-rw-r--r--tests/auto/testlib/selftests/expected_subtest.xunitxml8
8 files changed, 72 insertions, 72 deletions
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index a83a971d8a..3a776ea7cb 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -54,48 +54,48 @@
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS']]></Description>
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS']]></Description>
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '2'
- Expected (opB) size: '1']]></Description>
+ Actual (opA) size: 2
+ Expected (opB) size: 1]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '12'
- Expected (opB) size: '1']]></Description>
+ Actual (opA) size: 12
+ Expected (opB) size: 1]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '1'
- Expected (opB) size: '12']]></Description>
+ Actual (opA) size: 1
+ Expected (opB) size: 12]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
<Incident type="fail" file="tst_cmptest.cpp" line="320">
<Description><![CDATA[Compared lists differ at index 2.
- Actual (int1): '3'
- Expected (int2): '4']]></Description>
+ Actual (int1): 3
+ Expected (int2): 4]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
<Incident type="fail" file="tst_cmptest.cpp" line="327">
<Description><![CDATA[Compared lists differ at index 0.
- Actual (double1): '1.5'
- Expected (double2): '1']]></Description>
+ Actual (double1): 1.5
+ Expected (double2): 1]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index b3d34d49de..8473b4528e 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -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(equal lists)
FAIL! : tst_Cmptest::compareQStringLists(last item different) Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS'
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"
Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(second-last item different) Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS'
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"
Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(prefix) Compared lists have different sizes.
- Actual (opA) size: '2'
- Expected (opB) size: '1'
+ Actual (opA) size: 2
+ Expected (opB) size: 1
Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(short list second) Compared lists have different sizes.
- Actual (opA) size: '12'
- Expected (opB) size: '1'
+ Actual (opA) size: 12
+ Expected (opB) size: 1
Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have different sizes.
- Actual (opA) size: '1'
- Expected (opB) size: '12'
+ Actual (opA) size: 1
+ Expected (opB) size: 12
Loc: [tst_cmptest.cpp(313)]
FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
- Actual (int1): '3'
- Expected (int2): '4'
+ Actual (int1): 3
+ Expected (int2): 4
Loc: [tst_cmptest.cpp(320)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
- Actual (double1): '1.5'
- Expected (double2): '1'
+ Actual (double1): 1.5
+ Expected (double2): 1
Loc: [tst_cmptest.cpp(327)]
PASS : tst_Cmptest::compareQPixmaps(both null)
FAIL! : tst_Cmptest::compareQPixmaps(one null) Compared QPixmaps differ.
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index 08a40fb466..970544e4b6 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -56,48 +56,48 @@
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS']]></Description>
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[second-last item different]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (opA): 'string3'
- Expected (opB): 'DIFFERS']]></Description>
+ Actual (opA): "string3"
+ Expected (opB): "DIFFERS"]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[prefix]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '2'
- Expected (opB) size: '1']]></Description>
+ Actual (opA) size: 2
+ Expected (opB) size: 1]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list second]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '12'
- Expected (opB) size: '1']]></Description>
+ Actual (opA) size: 12
+ Expected (opB) size: 1]]></Description>
</Incident>
<Incident type="fail" file="tst_cmptest.cpp" line="313">
<DataTag><![CDATA[short list first]]></DataTag>
<Description><![CDATA[Compared lists have different sizes.
- Actual (opA) size: '1'
- Expected (opB) size: '12']]></Description>
+ Actual (opA) size: 1
+ Expected (opB) size: 12]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
<Incident type="fail" file="tst_cmptest.cpp" line="320">
<Description><![CDATA[Compared lists differ at index 2.
- Actual (int1): '3'
- Expected (int2): '4']]></Description>
+ Actual (int1): 3
+ Expected (int2): 4]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListDouble">
<Incident type="fail" file="tst_cmptest.cpp" line="327">
<Description><![CDATA[Compared lists differ at index 0.
- Actual (double1): '1.5'
- Expected (double2): '1']]></Description>
+ Actual (double1): 1.5
+ Expected (double2): 1]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xunitxml b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
index e7d76ac839..7874c6c52e 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xunitxml
@@ -23,30 +23,30 @@
</testcase>
<testcase result="fail" name="compareQStringLists">
<failure tag="last item different" message="Compared lists differ at index 2.
- Actual (opA): &apos;string3&apos;
- Expected (opB): &apos;DIFFERS&apos;" result="fail"/>
+ Actual (opA): &quot;string3&quot;
+ Expected (opB): &quot;DIFFERS&quot;" result="fail"/>
<failure tag="second&#x002D;last item different" message="Compared lists differ at index 2.
- Actual (opA): &apos;string3&apos;
- Expected (opB): &apos;DIFFERS&apos;" result="fail"/>
+ Actual (opA): &quot;string3&quot;
+ Expected (opB): &quot;DIFFERS&quot;" result="fail"/>
<failure tag="prefix" message="Compared lists have different sizes.
- Actual (opA) size: &apos;2&apos;
- Expected (opB) size: &apos;1&apos;" result="fail"/>
+ Actual (opA) size: 2
+ Expected (opB) size: 1" result="fail"/>
<failure tag="short list second" message="Compared lists have different sizes.
- Actual (opA) size: &apos;12&apos;
- Expected (opB) size: &apos;1&apos;" result="fail"/>
+ Actual (opA) size: 12
+ Expected (opB) size: 1" result="fail"/>
<failure tag="short list first" message="Compared lists have different sizes.
- Actual (opA) size: &apos;1&apos;
- Expected (opB) size: &apos;12&apos;" result="fail"/>
+ Actual (opA) size: 1
+ Expected (opB) size: 12" result="fail"/>
</testcase>
<testcase result="fail" name="compareQListInt">
<failure message="Compared lists differ at index 2.
- Actual (int1): &apos;3&apos;
- Expected (int2): &apos;4&apos;" result="fail"/>
+ Actual (int1): 3
+ Expected (int2): 4" result="fail"/>
</testcase>
<testcase result="fail" name="compareQListDouble">
<failure message="Compared lists differ at index 0.
- Actual (double1): &apos;1.5&apos;
- Expected (double2): &apos;1&apos;" result="fail"/>
+ Actual (double1): 1.5
+ Expected (double2): 1" result="fail"/>
</testcase>
<testcase result="fail" name="compareQPixmaps">
<failure tag="one null" message="Compared QPixmaps differ.
diff --git a/tests/auto/testlib/selftests/expected_subtest.lightxml b/tests/auto/testlib/selftests/expected_subtest.lightxml
index 90cfacbe0b..467fabb7ac 100644
--- a/tests/auto/testlib/selftests/expected_subtest.lightxml
+++ b/tests/auto/testlib/selftests/expected_subtest.lightxml
@@ -125,8 +125,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same
- Actual (str) : hello1
- Expected (QString("hello0")): hello0]]></Description>
+ Actual (str) : "hello1"
+ Expected (QString("hello0")): "hello0"]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data1]]></DataTag>
@@ -143,8 +143,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same
- Actual (str) : hello2
- Expected (QString("hello0")): hello0]]></Description>
+ Actual (str) : "hello2"
+ Expected (QString("hello0")): "hello0"]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag>
diff --git a/tests/auto/testlib/selftests/expected_subtest.txt b/tests/auto/testlib/selftests/expected_subtest.txt
index e874e0c020..9990b5439d 100644
--- a/tests/auto/testlib/selftests/expected_subtest.txt
+++ b/tests/auto/testlib/selftests/expected_subtest.txt
@@ -33,15 +33,15 @@ PASS : tst_Subtest::test3(data0)
QDEBUG : tst_Subtest::test3(data1) init test3 data1
QDEBUG : tst_Subtest::test3(data1) test2 test3 data1
FAIL! : tst_Subtest::test3(data1) Compared values are not the same
- Actual (str) : hello1
- Expected (QString("hello0")): hello0
+ Actual (str) : "hello1"
+ Expected (QString("hello0")): "hello0"
Loc: [tst_subtest.cpp(154)]
QDEBUG : tst_Subtest::test3(data1) cleanup test3 data1
QDEBUG : tst_Subtest::test3(data2) init test3 data2
QDEBUG : tst_Subtest::test3(data2) test2 test3 data2
FAIL! : tst_Subtest::test3(data2) Compared values are not the same
- Actual (str) : hello2
- Expected (QString("hello0")): hello0
+ Actual (str) : "hello2"
+ Expected (QString("hello0")): "hello0"
Loc: [tst_subtest.cpp(154)]
QDEBUG : tst_Subtest::test3(data2) cleanup test3 data2
QDEBUG : tst_Subtest::cleanupTestCase() cleanupTestCase cleanupTestCase (null)
diff --git a/tests/auto/testlib/selftests/expected_subtest.xml b/tests/auto/testlib/selftests/expected_subtest.xml
index cda4df01f3..1107bcb070 100644
--- a/tests/auto/testlib/selftests/expected_subtest.xml
+++ b/tests/auto/testlib/selftests/expected_subtest.xml
@@ -127,8 +127,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data1]]></DataTag>
<Description><![CDATA[Compared values are not the same
- Actual (str) : hello1
- Expected (QString("hello0")): hello0]]></Description>
+ Actual (str) : "hello1"
+ Expected (QString("hello0")): "hello0"]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data1]]></DataTag>
@@ -145,8 +145,8 @@
<Incident type="fail" file="tst_subtest.cpp" line="154">
<DataTag><![CDATA[data2]]></DataTag>
<Description><![CDATA[Compared values are not the same
- Actual (str) : hello2
- Expected (QString("hello0")): hello0]]></Description>
+ Actual (str) : "hello2"
+ Expected (QString("hello0")): "hello0"]]></Description>
</Incident>
<Message type="qdebug" file="" line="0">
<DataTag><![CDATA[data2]]></DataTag>
diff --git a/tests/auto/testlib/selftests/expected_subtest.xunitxml b/tests/auto/testlib/selftests/expected_subtest.xunitxml
index 5f7024e8ba..753711f837 100644
--- a/tests/auto/testlib/selftests/expected_subtest.xunitxml
+++ b/tests/auto/testlib/selftests/expected_subtest.xunitxml
@@ -38,14 +38,14 @@
<!-- tag="data1" message="init test3 data1" type="qdebug" -->
<!-- tag="data1" message="test2 test3 data1" type="qdebug" -->
<failure tag="data1" message="Compared values are not the same
- Actual (str) : hello1
- Expected (QString(&quot;hello0&quot;)): hello0" result="fail"/>
+ Actual (str) : &quot;hello1&quot;
+ Expected (QString(&quot;hello0&quot;)): &quot;hello0&quot;" result="fail"/>
<!-- tag="data1" message="cleanup test3 data1" type="qdebug" -->
<!-- tag="data2" message="init test3 data2" type="qdebug" -->
<!-- tag="data2" message="test2 test3 data2" type="qdebug" -->
<failure tag="data2" message="Compared values are not the same
- Actual (str) : hello2
- Expected (QString(&quot;hello0&quot;)): hello0" result="fail"/>
+ Actual (str) : &quot;hello2&quot;
+ Expected (QString(&quot;hello0&quot;)): &quot;hello0&quot;" result="fail"/>
<!-- tag="data2" message="cleanup test3 data2" type="qdebug" -->
</testcase>
<testcase result="pass" name="cleanupTestCase">