summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-06-30 11:25:46 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-01 06:44:30 +0200
commiteea930b4d7cabb6ada6155b66b5b143b73a10344 (patch)
treeba4929b2d134e601bcd693e14f8b6aaa680b0eb2 /tests/auto/testlib
parentda914a7d47971a67423318f68260602799e9aa4a (diff)
QTest: fix -Wformat-overflow GCC warning
Says GCC: In function ‘char* QTest::toString(QPair<T1, T2>&) [with T1 = QWidget*; T2 = QEvent::Type]’, warning: ‘%s’ directive argument is null [-Wformat-overflow=] Fix by re-using formatString(), once introduced for std::tuple. As a side-effect, this gets rid of the funny double-quotes around the output. Change-Id: I2dd5f10fa2b3a392370bf487c1b7e98f3d190978 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.junitxml8
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml8
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.tap16
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity4
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.txt8
-rw-r--r--tests/auto/testlib/selftests/expected_pairdiagnostics.xml8
6 files changed, 26 insertions, 26 deletions
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.junitxml b/tests/auto/testlib/selftests/expected_pairdiagnostics.junitxml
index 4086bd8273..1f6ce0ba06 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.junitxml
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.junitxml
@@ -8,13 +8,13 @@
<testcase name="initTestCase" result="pass" time="@TEST_DURATION@"/>
<testcase name="testQPair" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="Compared values are not the same
- Actual (pair1): &quot;std::pair(1,1)&quot;
- Expected (pair2): &quot;std::pair(1,2)&quot;"/>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)"/>
</testcase>
<testcase name="testStdPair" result="fail" time="@TEST_DURATION@">
<failure result="fail" message="Compared values are not the same
- Actual (pair1): &quot;std::pair(1,1)&quot;
- Expected (pair2): &quot;std::pair(1,2)&quot;"/>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)"/>
</testcase>
<testcase name="cleanupTestCase" result="pass" time="@TEST_DURATION@"/>
<system-err/>
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml b/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
index e4ceacc9e3..2770b4394a 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.lightxml
@@ -10,16 +10,16 @@
<TestFunction name="testQPair">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"]]></Description>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testStdPair">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"]]></Description>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.tap b/tests/auto/testlib/selftests/expected_pairdiagnostics.tap
index 25718d0d4c..a5ffbc31ef 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.tap
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.tap
@@ -5,10 +5,10 @@ not ok 2 - testQPair()
---
type: QCOMPARE
message: Compared values are not the same
- wanted: "std::pair(1,2)" (pair2)
- found: "std::pair(1,1)" (pair1)
- expected: "std::pair(1,2)" (pair2)
- actual: "std::pair(1,1)" (pair1)
+ wanted: std::pair(1, 2) (pair2)
+ found: std::pair(1, 1) (pair1)
+ expected: std::pair(1, 2) (pair2)
+ actual: std::pair(1, 1) (pair1)
at: tst_PairDiagnostics::testQPair() (qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp:0)
file: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp
line: 0
@@ -17,10 +17,10 @@ not ok 3 - testStdPair()
---
type: QCOMPARE
message: Compared values are not the same
- wanted: "std::pair(1,2)" (pair2)
- found: "std::pair(1,1)" (pair1)
- expected: "std::pair(1,2)" (pair2)
- actual: "std::pair(1,1)" (pair1)
+ wanted: std::pair(1, 2) (pair2)
+ found: std::pair(1, 1) (pair1)
+ expected: std::pair(1, 2) (pair2)
+ actual: std::pair(1, 1) (pair1)
at: tst_PairDiagnostics::testStdPair() (qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp:0)
file: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp
line: 0
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity b/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
index a86f4fa254..01f4a232e2 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.teamcity
@@ -2,10 +2,10 @@
##teamcity[testStarted name='initTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='initTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='testQPair()' flowId='tst_PairDiagnostics']
-##teamcity[testFailed name='testQPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): "std::pair(1,1)"|n Expected (pair2): "std::pair(1,2)"' flowId='tst_PairDiagnostics']
+##teamcity[testFailed name='testQPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): std::pair(1, 1)|n Expected (pair2): std::pair(1, 2)' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='testQPair()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='testStdPair()' flowId='tst_PairDiagnostics']
-##teamcity[testFailed name='testStdPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): "std::pair(1,1)"|n Expected (pair2): "std::pair(1,2)"' flowId='tst_PairDiagnostics']
+##teamcity[testFailed name='testStdPair()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)|]' details='Compared values are not the same|n Actual (pair1): std::pair(1, 1)|n Expected (pair2): std::pair(1, 2)' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='testStdPair()' flowId='tst_PairDiagnostics']
##teamcity[testStarted name='cleanupTestCase()' flowId='tst_PairDiagnostics']
##teamcity[testFinished name='cleanupTestCase()' flowId='tst_PairDiagnostics']
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.txt b/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
index cbb8b764ff..b225b4c55f 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.txt
@@ -2,12 +2,12 @@
Config: Using QtTest library
PASS : tst_PairDiagnostics::initTestCase()
FAIL! : tst_PairDiagnostics::testQPair() Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)
Loc: [qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)]
FAIL! : tst_PairDiagnostics::testStdPair() Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)
Loc: [qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp(0)]
PASS : tst_PairDiagnostics::cleanupTestCase()
Totals: 2 passed, 2 failed, 0 skipped, 0 blacklisted, 0ms
diff --git a/tests/auto/testlib/selftests/expected_pairdiagnostics.xml b/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
index 89e8ca49a6..503ea937aa 100644
--- a/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
+++ b/tests/auto/testlib/selftests/expected_pairdiagnostics.xml
@@ -12,16 +12,16 @@
<TestFunction name="testQPair">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"]]></Description>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="testStdPair">
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/pairdiagnostics/tst_pairdiagnostics.cpp" line="0">
<Description><![CDATA[Compared values are not the same
- Actual (pair1): "std::pair(1,1)"
- Expected (pair2): "std::pair(1,2)"]]></Description>
+ Actual (pair1): std::pair(1, 1)
+ Expected (pair2): std::pair(1, 2)]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>