summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp20
-rw-r--r--src/testlib/qtest.h69
-rw-r--r--src/testlib/qtestcase.qdoc19
-rw-r--r--tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp9
-rw-r--r--tests/auto/gui/util/qundogroup/tst_qundogroup.cpp13
-rw-r--r--tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp48
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.junitxml27
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.lightxml50
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.tap296
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.teamcity27
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.txt31
-rw-r--r--tests/auto/testlib/selftests/expected_cmptest.xml50
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp78
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp6
14 files changed, 533 insertions, 210 deletions
diff --git a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
index cfa999a6f4..01f4e11eb4 100644
--- a/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
+++ b/src/testlib/doc/snippets/code/src_qtestlib_qtestcase.cpp
@@ -49,6 +49,9 @@
****************************************************************************/
#include <QTest>
#include <QSqlDatabase>
+#include <QtGui/qfontdatabase.h>
+
+#include <initializer_list>
// dummy
class TestBenchmark : public QObject
@@ -246,3 +249,20 @@ QVERIFY2(file.open(QIODevice::WriteOnly),
.arg(file.fileName()).arg(file.errorString())));
//! [33]
}
+
+void compareListToArray()
+{
+//! [34]
+ const int expected[] = {8, 10, 12, 16, 20, 24};
+ QCOMPARE(QFontDatabase::standardSizes(), expected);
+//! [34]
+}
+
+void compareListToInitializerList()
+{
+//! [35]
+ #define ARG(...) __VA_ARGS__
+ QCOMPARE(QFontDatabase::standardSizes(), ARG({8, 10, 12, 16, 20, 24}));
+ #undef ARG
+//! [35]
+}
diff --git a/src/testlib/qtest.h b/src/testlib/qtest.h
index 9455a66fdd..0fbef0b7c2 100644
--- a/src/testlib/qtest.h
+++ b/src/testlib/qtest.h
@@ -64,6 +64,7 @@
#include <QtCore/qsize.h>
#include <QtCore/qrect.h>
+#include <initializer_list>
#include <memory>
QT_BEGIN_NAMESPACE
@@ -276,27 +277,36 @@ inline bool qCompare(QLatin1String const &t1, QString const &t2, const char *act
return qCompare(QString(t1), t2, actual, expected, file, line);
}
-template <typename T>
-inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual, const char *expected,
- const char *file, int line)
+namespace Internal {
+
+// Compare sequences of equal size
+template <typename ActualIterator, typename ExpectedIterator>
+bool compareSequence(ActualIterator actualIt, ActualIterator actualEnd,
+ ExpectedIterator expectedBegin, ExpectedIterator expectedEnd,
+ const char *actual, const char *expected,
+ const char *file, int line)
{
char msg[1024];
msg[0] = '\0';
- bool isOk = true;
- const int actualSize = t1.count();
- const int expectedSize = t2.count();
- if (actualSize != expectedSize) {
+
+ const qsizetype actualSize = actualEnd - actualIt;
+ const qsizetype expectedSize = expectedEnd - expectedBegin;
+ bool isOk = actualSize == expectedSize;
+
+ if (!isOk) {
qsnprintf(msg, sizeof(msg), "Compared lists have different sizes.\n"
- " Actual (%s) size: %d\n"
- " Expected (%s) size: %d", actual, actualSize, expected, expectedSize);
- isOk = false;
+ " Actual (%s) size: %zd\n"
+ " Expected (%s) size: %zd", actual, actualSize,
+ expected, expectedSize);
}
- for (int i = 0; isOk && i < actualSize; ++i) {
- if (!(t1.at(i) == t2.at(i))) {
- char *val1 = toString(t1.at(i));
- char *val2 = toString(t2.at(i));
- qsnprintf(msg, sizeof(msg), "Compared lists differ at index %d.\n"
+ for (auto expectedIt = expectedBegin; isOk && expectedIt < expectedEnd; ++actualIt, ++expectedIt) {
+ if (!(*actualIt == *expectedIt)) {
+ const qsizetype i = qsizetype(expectedIt - expectedBegin);
+ char *val1 = QTest::toString(*actualIt);
+ char *val2 = QTest::toString(*expectedIt);
+
+ qsnprintf(msg, sizeof(msg), "Compared lists differ at index %zd.\n"
" Actual (%s): %s\n"
" Expected (%s): %s", i, actual, val1 ? val1 : "<null>",
expected, val2 ? val2 : "<null>");
@@ -309,6 +319,35 @@ inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual,
return compare_helper(isOk, msg, nullptr, nullptr, actual, expected, file, line);
}
+} // namespace Internal
+
+template <typename T>
+inline bool qCompare(QList<T> const &t1, QList<T> const &t2, const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return Internal::compareSequence(t1.cbegin(), t1.cend(), t2.cbegin(), t2.cend(),
+ actual, expected, file, line);
+}
+
+template <typename T, int N>
+bool qCompare(QList<T> const &t1, std::initializer_list<T> t2,
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return Internal::compareSequence(t1.cbegin(), t1.cend(), t2.cbegin(), t2.cend(),
+ actual, expected, file, line);
+}
+
+// Compare QList against array
+template <typename T, int N>
+bool qCompare(QList<T> const &t1, const T (& t2)[N],
+ const char *actual, const char *expected,
+ const char *file, int line)
+{
+ return Internal::compareSequence(t1.cbegin(), t1.cend(), t2, t2 + N,
+ actual, expected, file, line);
+}
+
template <>
inline bool qCompare(QStringList const &t1, QStringList const &t2, const char *actual, const char *expected,
const char *file, int line)
diff --git a/src/testlib/qtestcase.qdoc b/src/testlib/qtestcase.qdoc
index 98112027a5..8c89b37baf 100644
--- a/src/testlib/qtestcase.qdoc
+++ b/src/testlib/qtestcase.qdoc
@@ -116,19 +116,28 @@
Expected. If the parameter order is swapped, debugging a failing test can be
confusing and tests expecting zero may fail due to rounding errors.
+ QCOMPARE() tries to output the contents of the values if the comparison fails,
+ so it is visible from the test log why the comparison failed.
+
+ Example:
+ \snippet code/src_qtestlib_qtestcase.cpp 2
+
When comparing floating-point types (\c float, \c double, and \c qfloat16),
\l qFuzzyCompare() is used for finite values. If qFuzzyIsNull() is true for
both values, they are also considered equal. Infinities match if they have
the same sign, and any NaN as actual value matches with any NaN as expected
value (even though NaN != NaN, even when they're identical).
- QCOMPARE() tries to output the contents of the values if the comparison fails,
- so it is visible from the test log why the comparison failed.
+ When comparing QList, arrays and initializer lists of the value type
+ can be passed as expected value:
+ \snippet code/src_qtestlib_qtestcase.cpp 34
- Example:
- \snippet code/src_qtestlib_qtestcase.cpp 2
+ Note that using initializer lists requires a defining a helper macro
+ to prevent the preprocessor from interpreting the commas as macro argument
+ delimiters:
+ \snippet code/src_qtestlib_qtestcase.cpp 35
- \note This macro can only be used in a test function that is invoked
+ \note QCOMPARE() can only be used in a test function that is invoked
by the test framework.
For your own classes, you can use \l QTest::toString() to format values for
diff --git a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
index 2be683ed13..da8ae5606f 100644
--- a/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
+++ b/tests/auto/gui/text/qglyphrun/tst_qglyphrun.cpp
@@ -493,6 +493,9 @@ void tst_QGlyphRun::drawMultiScriptText2()
void tst_QGlyphRun::detach()
{
+
+#define ARG(...) __VA_ARGS__
+
QGlyphRun glyphs;
glyphs.setGlyphIndexes(QList<quint32>() << 1 << 2 << 3);
@@ -504,8 +507,10 @@ void tst_QGlyphRun::detach()
otherGlyphs.setGlyphIndexes(QList<quint32>() << 4 << 5 << 6);
- QCOMPARE(otherGlyphs.glyphIndexes(), QList<quint32>() << 4 << 5 << 6);
- QCOMPARE(glyphs.glyphIndexes(), QList<quint32>() << 1 << 2 << 3);
+ QCOMPARE(otherGlyphs.glyphIndexes(), ARG({4, 5, 6}));
+ QCOMPARE(glyphs.glyphIndexes(), ARG({1, 2, 3}));
+
+#undef ARG
}
void tst_QGlyphRun::drawRightToLeft()
diff --git a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
index 1565d90f87..617e0239e1 100644
--- a/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
+++ b/tests/auto/gui/util/qundogroup/tst_qundogroup.cpp
@@ -237,20 +237,21 @@ void tst_QUndoGroup::addRemoveStack()
QUndoGroup group;
QUndoStack stack1(&group);
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << &stack1);
+ QCOMPARE(group.stacks(), {&stack1});
QUndoStack stack2;
+ QUndoStack *expected12[] = {&stack1, &stack2};
group.addStack(&stack2);
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << &stack1 << &stack2);
+ QCOMPARE(group.stacks(), expected12);
group.addStack(&stack1);
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << &stack1 << &stack2);
+ QCOMPARE(group.stacks(), expected12);
group.removeStack(&stack1);
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << &stack2);
+ QCOMPARE(group.stacks(), {&stack2});
group.removeStack(&stack1);
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << &stack2);
+ QCOMPARE(group.stacks(), {&stack2});
group.removeStack(&stack2);
QVERIFY(group.stacks().isEmpty());
@@ -280,7 +281,7 @@ void tst_QUndoGroup::deleteStack()
QCOMPARE(group.activeStack(), stack1);
delete stack1;
- QCOMPARE(group.stacks(), QList<QUndoStack*>() << stack3);
+ QCOMPARE(group.stacks(), {stack3});
QCOMPARE(group.activeStack(), nullptr);
stack3->setActive(false);
diff --git a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
index ff6375292f..fca49c9e07 100644
--- a/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+++ b/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
@@ -141,7 +141,12 @@ private slots:
void compare_tostring_data();
void compareQStringLists();
void compareQStringLists_data();
+ void compareQListInt_data();
void compareQListInt();
+ void compareQListIntToArray_data();
+ void compareQListIntToArray();
+ void compareQListIntToInitializerList_data();
+ void compareQListIntToInitializerList();
void compareQListDouble();
#ifdef QT_GUI_LIB
void compareQColor_data();
@@ -425,11 +430,48 @@ void tst_Cmptest::compareQStringLists()
QCOMPARE(opA, opB);
}
+using IntList = QList<int>;
+
+void tst_Cmptest::compareQListInt_data()
+{
+ QTest::addColumn<IntList>("actual");
+
+ QTest::newRow("match") << IntList{1, 2, 3};
+ QTest::newRow("size mismatch") << IntList{1, 2};
+ QTest::newRow("value mismatch") << IntList{1, 2, 4};
+}
+
void tst_Cmptest::compareQListInt()
{
- QList<int> int1; int1 << 1 << 2 << 3;
- QList<int> int2; int2 << 1 << 2 << 4;
- QCOMPARE(int1, int2);
+ QFETCH(IntList, actual);
+ const QList<int> expected{1, 2, 3};
+ QCOMPARE(actual, expected);
+}
+
+void tst_Cmptest::compareQListIntToArray_data()
+{
+ compareQListInt_data();
+}
+
+void tst_Cmptest::compareQListIntToArray()
+{
+ QFETCH(IntList, actual);
+ const int expected[] = {1, 2, 3};
+ QCOMPARE(actual, expected);
+}
+
+void tst_Cmptest::compareQListIntToInitializerList_data()
+{
+ compareQListInt_data();
+}
+
+void tst_Cmptest::compareQListIntToInitializerList()
+{
+ QFETCH(IntList, actual);
+ // Protect ',' in the list
+#define ARG(...) __VA_ARGS__
+ QCOMPARE(actual, ARG({1, 2, 3}));
+#undef ARG
}
void tst_Cmptest::compareQListDouble()
diff --git a/tests/auto/testlib/selftests/expected_cmptest.junitxml b/tests/auto/testlib/selftests/expected_cmptest.junitxml
index 397db4c3e4..937003466e 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.junitxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.junitxml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<testsuite errors="0" failures="40" tests="26" name="tst_Cmptest">
+<testsuite errors="0" failures="45" tests="28" name="tst_Cmptest">
<properties>
<property value="@INSERT_QT_VERSION_HERE@" name="QTestVersion"/>
<property value="@INSERT_QT_VERSION_HERE@" name="QtVersion"/>
@@ -70,9 +70,28 @@
Expected (opB) size: 12" result="fail"/>
</testcase>
<testcase result="fail" name="compareQListInt">
- <failure message="Compared lists differ at index 2.
- Actual (int1): 3
- Expected (int2): 4" result="fail"/>
+ <failure tag="size mismatch" message="Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3" result="fail"/>
+ <failure tag="value mismatch" message="Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compareQListIntToArray">
+ <failure tag="size mismatch" message="Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3" result="fail"/>
+ <failure tag="value mismatch" message="Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3" result="fail"/>
+ </testcase>
+ <testcase result="fail" name="compareQListIntToInitializerList">
+ <failure tag="size mismatch" message="Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3" result="fail"/>
+ <failure tag="value mismatch" message="Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (ARG({1, 2, 3})): 3" result="fail"/>
</testcase>
<testcase result="fail" name="compareQListDouble">
<failure message="Compared lists differ at index 0.
diff --git a/tests/auto/testlib/selftests/expected_cmptest.lightxml b/tests/auto/testlib/selftests/expected_cmptest.lightxml
index f108933585..ee2ca716a3 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.lightxml
+++ b/tests/auto/testlib/selftests/expected_cmptest.lightxml
@@ -147,10 +147,56 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareQListIntToArray">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareQListIntToInitializerList">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3]]></Description>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (int1): 3
- Expected (int2): 4]]></Description>
+ Actual (actual): 4
+ Expected (ARG({1, 2, 3})): 3]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/testlib/selftests/expected_cmptest.tap b/tests/auto/testlib/selftests/expected_cmptest.tap
index dc9cb5c950..68cf4f80d2 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.tap
+++ b/tests/auto/testlib/selftests/expected_cmptest.tap
@@ -4,9 +4,9 @@ ok 1 - initTestCase()
not ok 2 - compare_unregistered_enums()
---
# Compared values are not the same
- at: tst_Cmptest::compare_unregistered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:171)
+ at: tst_Cmptest::compare_unregistered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:176)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 171
+ line: 176
...
not ok 3 - compare_registered_enums()
---
@@ -16,9 +16,9 @@ not ok 3 - compare_registered_enums()
found: Monday (Qt::Monday)
expected: Sunday (Qt::Sunday)
actual: Monday (Qt::Monday)
- at: tst_Cmptest::compare_registered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:178)
+ at: tst_Cmptest::compare_registered_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:183)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 178
+ line: 183
...
not ok 4 - compare_class_enums()
---
@@ -28,9 +28,9 @@ not ok 4 - compare_class_enums()
found: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
expected: MyClassEnumValue2 (MyClassEnum::MyClassEnumValue2)
actual: MyClassEnumValue1 (MyClassEnum::MyClassEnumValue1)
- at: tst_Cmptest::compare_class_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:184)
+ at: tst_Cmptest::compare_class_enums() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:189)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 184
+ line: 189
...
ok 5 - test_windowflags(pass)
not ok 6 - test_windowflags(fail1)
@@ -41,9 +41,9 @@ not ok 6 - test_windowflags(fail1)
found: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
expected: Window|FramelessWindowHint|WindowSystemMenuHint|WindowStaysOnBottomHint (expectedWindowFlags)
actual: Window|WindowSystemMenuHint|WindowStaysOnBottomHint (actualWindowFlags)
- at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:209)
+ at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:214)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 209
+ line: 214
...
not ok 7 - test_windowflags(fail2)
---
@@ -53,9 +53,9 @@ not ok 7 - test_windowflags(fail2)
found: Window (actualWindowFlags)
expected: Window|FramelessWindowHint (expectedWindowFlags)
actual: Window (actualWindowFlags)
- at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:209)
+ at: tst_Cmptest::test_windowflags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:214)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 209
+ line: 214
...
ok 8 - test_unregistered_flags(pass)
not ok 9 - test_unregistered_flags(fail1)
@@ -66,9 +66,9 @@ not ok 9 - test_unregistered_flags(fail1)
found: 0x3 (actualFlags)
expected: 0x5 (expectedFlags)
actual: 0x3 (actualFlags)
- at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:242)
+ at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:247)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 242
+ line: 247
...
not ok 10 - test_unregistered_flags(fail2)
---
@@ -78,9 +78,9 @@ not ok 10 - test_unregistered_flags(fail2)
found: 0x1 (actualFlags)
expected: 0x5 (expectedFlags)
actual: 0x1 (actualFlags)
- at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:242)
+ at: tst_Cmptest::test_unregistered_flags() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:247)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 242
+ line: 247
...
ok 11 - compare_boolfuncs()
ok 12 - compare_to_nullptr()
@@ -93,9 +93,9 @@ not ok 14 - compare_tostring(int, string)
found: QVariant(int,123) (actual)
expected: QVariant(QString,hi) (expected)
actual: QVariant(int,123) (actual)
- at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:336)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 331
+ line: 336
...
ok 15 - compare_tostring(both invalid)
not ok 16 - compare_tostring(null hash, invalid)
@@ -106,9 +106,9 @@ not ok 16 - compare_tostring(null hash, invalid)
found: QVariant(QVariantHash) (actual)
expected: QVariant() (expected)
actual: QVariant(QVariantHash) (actual)
- at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:336)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 331
+ line: 336
...
not ok 17 - compare_tostring(string, null user type)
---
@@ -118,9 +118,9 @@ not ok 17 - compare_tostring(string, null user type)
found: QVariant(QString,A simple string) (actual)
expected: QVariant(PhonyClass) (expected)
actual: QVariant(QString,A simple string) (actual)
- at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:336)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 331
+ line: 336
...
not ok 18 - compare_tostring(both non-null user type)
---
@@ -130,9 +130,9 @@ not ok 18 - compare_tostring(both non-null user type)
found: QVariant(PhonyClass,<value not representable as string>) (actual)
expected: QVariant(PhonyClass,<value not representable as string>) (expected)
actual: QVariant(PhonyClass,<value not representable as string>) (actual)
- at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:331)
+ at: tst_Cmptest::compare_tostring() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:336)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 331
+ line: 336
...
ok 19 - compareQStringLists(empty lists)
ok 20 - compareQStringLists(equal lists)
@@ -144,9 +144,9 @@ not ok 21 - compareQStringLists(last item different)
found: "string3" (opA)
expected: "DIFFERS" (opB)
actual: "string3" (opA)
- at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:430)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 425
+ line: 430
...
not ok 22 - compareQStringLists(second-last item different)
---
@@ -156,50 +156,104 @@ not ok 22 - compareQStringLists(second-last item different)
found: "string3" (opA)
expected: "DIFFERS" (opB)
actual: "string3" (opA)
- at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:430)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 425
+ line: 430
...
not ok 23 - compareQStringLists(prefix)
---
# Compared lists have different sizes.
Actual (opA) size: 2
Expected (opB) size: 1
- at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:430)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 425
+ line: 430
...
not ok 24 - compareQStringLists(short list second)
---
# Compared lists have different sizes.
Actual (opA) size: 12
Expected (opB) size: 1
- at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:430)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 425
+ line: 430
...
not ok 25 - compareQStringLists(short list first)
---
# Compared lists have different sizes.
Actual (opA) size: 1
Expected (opB) size: 12
- at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:425)
+ at: tst_Cmptest::compareQStringLists() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:430)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 425
+ line: 430
...
-not ok 26 - compareQListInt()
+ok 26 - compareQListInt(match)
+not ok 27 - compareQListInt(size mismatch)
+ ---
+ # Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:448)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 448
+ ...
+not ok 28 - compareQListInt(value mismatch)
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 2.
+ wanted: 3 (expected)
+ found: 4 (actual)
+ expected: 3 (expected)
+ actual: 4 (actual)
+ at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:448)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 448
+ ...
+ok 29 - compareQListIntToArray(match)
+not ok 30 - compareQListIntToArray(size mismatch)
+ ---
+ # Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ at: tst_Cmptest::compareQListIntToArray() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:460)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 460
+ ...
+not ok 31 - compareQListIntToArray(value mismatch)
+ ---
+ type: QCOMPARE
+ message: Compared lists differ at index 2.
+ wanted: 3 (expected)
+ found: 4 (actual)
+ expected: 3 (expected)
+ actual: 4 (actual)
+ at: tst_Cmptest::compareQListIntToArray() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:460)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 460
+ ...
+ok 32 - compareQListIntToInitializerList(match)
+not ok 33 - compareQListIntToInitializerList(size mismatch)
+ ---
+ # Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3
+ at: tst_Cmptest::compareQListIntToInitializerList() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:473)
+ file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
+ line: 473
+ ...
+not ok 34 - compareQListIntToInitializerList(value mismatch)
---
type: QCOMPARE
message: Compared lists differ at index 2.
- wanted: 4 (int2)
- found: 3 (int1)
- expected: 4 (int2)
- actual: 3 (int1)
- at: tst_Cmptest::compareQListInt() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:432)
+ wanted: 3 (ARG({1, 2, 3}))
+ found: 4 (actual)
+ expected: 3 (ARG({1, 2, 3}))
+ actual: 4 (actual)
+ at: tst_Cmptest::compareQListIntToInitializerList() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:473)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 432
+ line: 473
...
-not ok 27 - compareQListDouble()
+not ok 35 - compareQListDouble()
---
type: QCOMPARE
message: Compared lists differ at index 0.
@@ -207,12 +261,12 @@ not ok 27 - compareQListDouble()
found: 1.5 (double1)
expected: 1 (double2)
actual: 1.5 (double1)
- at: tst_Cmptest::compareQListDouble() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:439)
+ at: tst_Cmptest::compareQListDouble() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:481)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 439
+ line: 481
...
-ok 28 - compareQColor(Qt::yellow vs "yellow")
-not ok 29 - compareQColor(Qt::yellow vs Qt::green)
+ok 36 - compareQColor(Qt::yellow vs "yellow")
+not ok 37 - compareQColor(Qt::yellow vs Qt::green)
---
type: QCOMPARE
message: Compared values are not the same
@@ -220,11 +274,11 @@ not ok 29 - compareQColor(Qt::yellow vs Qt::green)
found: #ffffff00 (colorA)
expected: #ff00ff00 (colorB)
actual: #ffffff00 (colorA)
- at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:458)
+ at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:500)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 458
+ line: 500
...
-not ok 30 - compareQColor(0x88ff0000 vs 0xffff0000)
+not ok 38 - compareQColor(0x88ff0000 vs 0xffff0000)
---
type: QCOMPARE
message: Compared values are not the same
@@ -232,12 +286,12 @@ not ok 30 - compareQColor(0x88ff0000 vs 0xffff0000)
found: #88ff0000 (colorA)
expected: #ffff0000 (colorB)
actual: #88ff0000 (colorA)
- at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:458)
+ at: tst_Cmptest::compareQColor() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:500)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 458
+ line: 500
...
-ok 31 - compareQPixmaps(both null)
-not ok 32 - compareQPixmaps(one null)
+ok 39 - compareQPixmaps(both null)
+not ok 40 - compareQPixmaps(one null)
---
type: QCOMPARE
message: Compared QPixmaps differ.
@@ -245,11 +299,11 @@ not ok 32 - compareQPixmaps(one null)
found: 1 (opA).isNull()
expected: 0 (opB).isNull()
actual: 1 (opA).isNull()
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:528)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 486
+ line: 528
...
-not ok 33 - compareQPixmaps(other null)
+not ok 41 - compareQPixmaps(other null)
---
type: QCOMPARE
message: Compared QPixmaps differ.
@@ -257,12 +311,12 @@ not ok 33 - compareQPixmaps(other null)
found: 0 (opA).isNull()
expected: 1 (opB).isNull()
actual: 0 (opA).isNull()
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:528)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 486
+ line: 528
...
-ok 34 - compareQPixmaps(equal)
-not ok 35 - compareQPixmaps(different size)
+ok 42 - compareQPixmaps(equal)
+not ok 43 - compareQPixmaps(different size)
---
type: QCOMPARE
message: Compared QPixmaps differ in size.
@@ -270,18 +324,18 @@ not ok 35 - compareQPixmaps(different size)
found: 11x20 (opA)
expected: 20x20 (opB)
actual: 11x20 (opA)
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:528)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 486
+ line: 528
...
-not ok 36 - compareQPixmaps(different pixels)
+not ok 44 - compareQPixmaps(different pixels)
---
# Compared values are not the same
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:528)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 486
+ line: 528
...
-not ok 37 - compareQPixmaps(different dpr)
+not ok 45 - compareQPixmaps(different dpr)
---
type: QCOMPARE
message: Compared QPixmaps differ in device pixel ratio.
@@ -289,12 +343,12 @@ not ok 37 - compareQPixmaps(different dpr)
found: 1 (opA)
expected: 2 (opB)
actual: 1 (opA)
- at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:486)
+ at: tst_Cmptest::compareQPixmaps() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:528)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 486
+ line: 528
...
-ok 38 - compareQImages(both null)
-not ok 39 - compareQImages(one null)
+ok 46 - compareQImages(both null)
+not ok 47 - compareQImages(one null)
---
type: QCOMPARE
message: Compared QImages differ.
@@ -302,11 +356,11 @@ not ok 39 - compareQImages(one null)
found: 1 (opA).isNull()
expected: 0 (opB).isNull()
actual: 1 (opA).isNull()
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-not ok 40 - compareQImages(other null)
+not ok 48 - compareQImages(other null)
---
type: QCOMPARE
message: Compared QImages differ.
@@ -314,12 +368,12 @@ not ok 40 - compareQImages(other null)
found: 0 (opA).isNull()
expected: 1 (opB).isNull()
actual: 0 (opA).isNull()
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-ok 41 - compareQImages(equal)
-not ok 42 - compareQImages(different size)
+ok 49 - compareQImages(equal)
+not ok 50 - compareQImages(different size)
---
type: QCOMPARE
message: Compared QImages differ in size.
@@ -327,11 +381,11 @@ not ok 42 - compareQImages(different size)
found: 11x20 (opA)
expected: 20x20 (opB)
actual: 11x20 (opA)
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-not ok 43 - compareQImages(different format)
+not ok 51 - compareQImages(different format)
---
type: QCOMPARE
message: Compared QImages differ in format.
@@ -339,18 +393,18 @@ not ok 43 - compareQImages(different format)
found: 6 (opA)
expected: 3 (opB)
actual: 6 (opA)
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-not ok 44 - compareQImages(different pixels)
+not ok 52 - compareQImages(different pixels)
---
# Compared values are not the same
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-not ok 45 - compareQImages(different dpr)
+not ok 53 - compareQImages(different dpr)
---
type: QCOMPARE
message: Compared QImages differ in device pixel ratio.
@@ -358,12 +412,12 @@ not ok 45 - compareQImages(different dpr)
found: 1 (opA)
expected: 2 (opB)
actual: 1 (opA)
- at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:516)
+ at: tst_Cmptest::compareQImages() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:558)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 516
+ line: 558
...
-ok 46 - compareQRegion(equal-empty)
-not ok 47 - compareQRegion(1-empty)
+ok 54 - compareQRegion(equal-empty)
+not ok 55 - compareQRegion(1-empty)
---
type: QCOMPARE
message: Compared values are not the same
@@ -371,12 +425,12 @@ not ok 47 - compareQRegion(1-empty)
found: QRegion(200x50+10+10) (rA)
expected: QRegion(null) (rB)
actual: QRegion(200x50+10+10) (rA)
- at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:581)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 539
+ line: 581
...
-ok 48 - compareQRegion(equal)
-not ok 49 - compareQRegion(different lists)
+ok 56 - compareQRegion(equal)
+not ok 57 - compareQRegion(different lists)
---
type: QCOMPARE
message: Compared values are not the same
@@ -384,11 +438,11 @@ not ok 49 - compareQRegion(different lists)
found: QRegion(200x50+10+10) (rA)
expected: QRegion(2 rectangles, 50x200+100+200, 200x50+10+10) (rB)
actual: QRegion(200x50+10+10) (rA)
- at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:539)
+ at: tst_Cmptest::compareQRegion() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:581)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 539
+ line: 581
...
-not ok 50 - compareQVector2D()
+not ok 58 - compareQVector2D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -396,11 +450,11 @@ not ok 50 - compareQVector2D()
found: QVector2D(1, 2) (v2a)
expected: QVector2D(1, 3) (v2b)
actual: QVector2D(1, 2) (v2a)
- at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:548)
+ at: tst_Cmptest::compareQVector2D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 548
+ line: 590
...
-not ok 51 - compareQVector3D()
+not ok 59 - compareQVector3D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -408,11 +462,11 @@ not ok 51 - compareQVector3D()
found: QVector3D(1, 2, 3) (v3a)
expected: QVector3D(1, 3, 3) (v3b)
actual: QVector3D(1, 2, 3) (v3a)
- at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:557)
+ at: tst_Cmptest::compareQVector3D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:599)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 557
+ line: 599
...
-not ok 52 - compareQVector4D()
+not ok 60 - compareQVector4D()
---
type: QCOMPARE
message: Compared values are not the same
@@ -420,11 +474,11 @@ not ok 52 - compareQVector4D()
found: QVector4D(1, 2, 3, 4) (v4a)
expected: QVector4D(1, 3, 3, 4) (v4b)
actual: QVector4D(1, 2, 3, 4) (v4a)
- at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:566)
+ at: tst_Cmptest::compareQVector4D() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:608)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 566
+ line: 608
...
-not ok 53 - verify()
+not ok 61 - verify()
---
type: QVERIFY
message: Verification failed
@@ -432,11 +486,11 @@ not ok 53 - verify()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:578)
+ at: tst_Cmptest::verify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:620)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 578
+ line: 620
...
-not ok 54 - verify2()
+not ok 62 - verify2()
---
type: QVERIFY
message: 42
@@ -444,11 +498,11 @@ not ok 54 - verify2()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:584)
+ at: tst_Cmptest::verify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:626)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 584
+ line: 626
...
-not ok 55 - tryVerify()
+not ok 63 - tryVerify()
---
type: QVERIFY
message: Verification failed
@@ -456,11 +510,11 @@ not ok 55 - tryVerify()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:590)
+ at: tst_Cmptest::tryVerify() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:632)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 590
+ line: 632
...
-not ok 56 - tryVerify2()
+not ok 64 - tryVerify2()
---
type: QVERIFY
message: 42
@@ -468,13 +522,13 @@ not ok 56 - tryVerify2()
found: false (opaqueFunc() < 2)
expected: true (opaqueFunc() < 2)
actual: false (opaqueFunc() < 2)
- at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:596)
+ at: tst_Cmptest::tryVerify2() (qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp:638)
file: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp
- line: 596
+ line: 638
...
-ok 57 - verifyExplicitOperatorBool()
-ok 58 - cleanupTestCase()
-1..58
-# tests 58
-# pass 18
-# fail 40
+ok 65 - verifyExplicitOperatorBool()
+ok 66 - cleanupTestCase()
+1..66
+# tests 66
+# pass 21
+# fail 45
diff --git a/tests/auto/testlib/selftests/expected_cmptest.teamcity b/tests/auto/testlib/selftests/expected_cmptest.teamcity
index 426fddb20f..e971f2fd4b 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.teamcity
+++ b/tests/auto/testlib/selftests/expected_cmptest.teamcity
@@ -65,9 +65,30 @@
##teamcity[testStarted name='compareQStringLists(short list first)' flowId='tst_Cmptest']
##teamcity[testFailed name='compareQStringLists(short list first)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists have different sizes.|n Actual (opA) size: 1|n Expected (opB) size: 12' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQStringLists(short list first)' flowId='tst_Cmptest']
-##teamcity[testStarted name='compareQListInt()' flowId='tst_Cmptest']
-##teamcity[testFailed name='compareQListInt()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists differ at index 2.|n Actual (int1): 3|n Expected (int2): 4' flowId='tst_Cmptest']
-##teamcity[testFinished name='compareQListInt()' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListInt(match)' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListInt(match)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListInt(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListInt(size mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists have different sizes.|n Actual (actual) size: 2|n Expected (expected) size: 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListInt(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListInt(value mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListInt(value mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists differ at index 2.|n Actual (actual): 4|n Expected (expected): 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListInt(value mismatch)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToArray(match)' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToArray(match)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToArray(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListIntToArray(size mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists have different sizes.|n Actual (actual) size: 2|n Expected (expected) size: 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToArray(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToArray(value mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListIntToArray(value mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists differ at index 2.|n Actual (actual): 4|n Expected (expected): 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToArray(value mismatch)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToInitializerList(match)' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToInitializerList(match)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToInitializerList(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListIntToInitializerList(size mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists have different sizes.|n Actual (actual) size: 2|n Expected (ARG({1, 2, 3})) size: 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToInitializerList(size mismatch)' flowId='tst_Cmptest']
+##teamcity[testStarted name='compareQListIntToInitializerList(value mismatch)' flowId='tst_Cmptest']
+##teamcity[testFailed name='compareQListIntToInitializerList(value mismatch)' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists differ at index 2.|n Actual (actual): 4|n Expected (ARG({1, 2, 3})): 3' flowId='tst_Cmptest']
+##teamcity[testFinished name='compareQListIntToInitializerList(value mismatch)' flowId='tst_Cmptest']
##teamcity[testStarted name='compareQListDouble()' flowId='tst_Cmptest']
##teamcity[testFailed name='compareQListDouble()' message='Failure! |[Loc: qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)|]' details='Compared lists differ at index 0.|n Actual (double1): 1.5|n Expected (double2): 1' flowId='tst_Cmptest']
##teamcity[testFinished name='compareQListDouble()' flowId='tst_Cmptest']
diff --git a/tests/auto/testlib/selftests/expected_cmptest.txt b/tests/auto/testlib/selftests/expected_cmptest.txt
index 08877ef74d..527ec991bb 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.txt
+++ b/tests/auto/testlib/selftests/expected_cmptest.txt
@@ -71,9 +71,32 @@ FAIL! : tst_Cmptest::compareQStringLists(short list first) Compared lists have
Actual (opA) size: 1
Expected (opB) size: 12
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
-FAIL! : tst_Cmptest::compareQListInt() Compared lists differ at index 2.
- Actual (int1): 3
- Expected (int2): 4
+PASS : tst_Cmptest::compareQListInt(match)
+FAIL! : tst_Cmptest::compareQListInt(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListInt(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::compareQListIntToArray(match)
+FAIL! : tst_Cmptest::compareQListIntToArray(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListIntToArray(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+PASS : tst_Cmptest::compareQListIntToInitializerList(match)
+FAIL! : tst_Cmptest::compareQListIntToInitializerList(size mismatch) Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3
+ Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
+FAIL! : tst_Cmptest::compareQListIntToInitializerList(value mismatch) Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (ARG({1, 2, 3})): 3
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
FAIL! : tst_Cmptest::compareQListDouble() Compared lists differ at index 0.
Actual (double1): 1.5
@@ -164,5 +187,5 @@ FAIL! : tst_Cmptest::tryVerify2() 'opaqueFunc() < 2' returned FALSE. (42)
Loc: [qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp(0)]
PASS : tst_Cmptest::verifyExplicitOperatorBool()
PASS : tst_Cmptest::cleanupTestCase()
-Totals: 18 passed, 40 failed, 0 skipped, 0 blacklisted, 0ms
+Totals: 21 passed, 45 failed, 0 skipped, 0 blacklisted, 0ms
********* Finished testing of tst_Cmptest *********
diff --git a/tests/auto/testlib/selftests/expected_cmptest.xml b/tests/auto/testlib/selftests/expected_cmptest.xml
index daf2560f1b..c89f177a13 100644
--- a/tests/auto/testlib/selftests/expected_cmptest.xml
+++ b/tests/auto/testlib/selftests/expected_cmptest.xml
@@ -149,10 +149,56 @@
<Duration msecs="0"/>
</TestFunction>
<TestFunction name="compareQListInt">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareQListIntToArray">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (expected) size: 3]]></Description>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists differ at index 2.
+ Actual (actual): 4
+ Expected (expected): 3]]></Description>
+</Incident>
+ <Duration msecs="0"/>
+</TestFunction>
+<TestFunction name="compareQListIntToInitializerList">
+<Incident type="pass" file="" line="0">
+ <DataTag><![CDATA[match]]></DataTag>
+</Incident>
+<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[size mismatch]]></DataTag>
+ <Description><![CDATA[Compared lists have different sizes.
+ Actual (actual) size: 2
+ Expected (ARG({1, 2, 3})) size: 3]]></Description>
+</Incident>
<Incident type="fail" file="qtbase/tests/auto/testlib/selftests/cmptest/tst_cmptest.cpp" line="0">
+ <DataTag><![CDATA[value mismatch]]></DataTag>
<Description><![CDATA[Compared lists differ at index 2.
- Actual (int1): 3
- Expected (int2): 4]]></Description>
+ Actual (actual): 4
+ Expected (ARG({1, 2, 3})): 3]]></Description>
</Incident>
<Duration msecs="0"/>
</TestFunction>
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index 3365ccd179..5ecb401284 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -647,14 +647,14 @@ void tst_QGraphicsScene::items_QRectF()
item3->setZValue(2);
item4->setZValue(3);
- QCOMPARE(scene.items(QRectF(-10, -10, 10, 10)), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(QRectF(10, -10, 10, 10)), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(QRectF(10, 10, 10, 10)), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(QRectF(-10, 10, 10, 10)), QList<QGraphicsItem *>() << item4);
- QCOMPARE(scene.items(QRectF(-10, -10, 1, 1)), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(QRectF(10, -10, 1, 1)), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(QRectF(10, 10, 1, 1)), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(QRectF(-10, 10, 1, 1)), QList<QGraphicsItem *>() << item4);
+ QCOMPARE(scene.items(QRectF(-10, -10, 10, 10)), {item1});
+ QCOMPARE(scene.items(QRectF(10, -10, 10, 10)), {item2});
+ QCOMPARE(scene.items(QRectF(10, 10, 10, 10)), {item3});
+ QCOMPARE(scene.items(QRectF(-10, 10, 10, 10)), {item4});
+ QCOMPARE(scene.items(QRectF(-10, -10, 1, 1)), {item1});
+ QCOMPARE(scene.items(QRectF(10, -10, 1, 1)), {item2});
+ QCOMPARE(scene.items(QRectF(10, 10, 1, 1)), {item3});
+ QCOMPARE(scene.items(QRectF(-10, 10, 1, 1)), {item4});
QCOMPARE(scene.items(QRectF(-10, -10, 40, 10)), QList<QGraphicsItem *>() << item2 << item1);
QCOMPARE(scene.items(QRectF(-10, 10, 40, 10)), QList<QGraphicsItem *>() << item4 << item3);
@@ -771,20 +771,20 @@ void tst_QGraphicsScene::items_QPolygonF()
QPolygonF poly3(item3->boundingRect());
QPolygonF poly4(item4->boundingRect());
- QCOMPARE(scene.items(poly1), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(poly2), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(poly3), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(poly4), QList<QGraphicsItem *>() << item4);
+ QCOMPARE(scene.items(poly1), {item1});
+ QCOMPARE(scene.items(poly2), {item2});
+ QCOMPARE(scene.items(poly3), {item3});
+ QCOMPARE(scene.items(poly4), {item4});
poly1 = QPolygonF(QRectF(-10, -10, 1, 1));
poly2 = QPolygonF(QRectF(10, -10, 1, 1));
poly3 = QPolygonF(QRectF(10, 10, 1, 1));
poly4 = QPolygonF(QRectF(-10, 10, 1, 1));
- QCOMPARE(scene.items(poly1), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(poly2), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(poly3), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(poly4), QList<QGraphicsItem *>() << item4);
+ QCOMPARE(scene.items(poly1), {item1});
+ QCOMPARE(scene.items(poly2), {item2});
+ QCOMPARE(scene.items(poly3), {item3});
+ QCOMPARE(scene.items(poly4), {item4});
poly1 = QPolygonF(QRectF(-10, -10, 40, 10));
poly2 = QPolygonF(QRectF(-10, 10, 40, 10));
@@ -861,20 +861,20 @@ void tst_QGraphicsScene::items_QPainterPath()
QPainterPath path3; path3.addEllipse(item3->boundingRect());
QPainterPath path4; path4.addEllipse(item4->boundingRect());
- QCOMPARE(scene.items(path1), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(path2), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(path3), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(path4), QList<QGraphicsItem *>() << item4);
+ QCOMPARE(scene.items(path1), {item1});
+ QCOMPARE(scene.items(path2), {item2});
+ QCOMPARE(scene.items(path3), {item3});
+ QCOMPARE(scene.items(path4), {item4});
path1 = QPainterPath(); path1.addEllipse(QRectF(-10, -10, 1, 1));
path2 = QPainterPath(); path2.addEllipse(QRectF(10, -10, 1, 1));
path3 = QPainterPath(); path3.addEllipse(QRectF(10, 10, 1, 1));
path4 = QPainterPath(); path4.addEllipse(QRectF(-10, 10, 1, 1));
- QCOMPARE(scene.items(path1), QList<QGraphicsItem *>() << item1);
- QCOMPARE(scene.items(path2), QList<QGraphicsItem *>() << item2);
- QCOMPARE(scene.items(path3), QList<QGraphicsItem *>() << item3);
- QCOMPARE(scene.items(path4), QList<QGraphicsItem *>() << item4);
+ QCOMPARE(scene.items(path1), {item1});
+ QCOMPARE(scene.items(path2), {item2});
+ QCOMPARE(scene.items(path3), {item3});
+ QCOMPARE(scene.items(path4), {item4});
path1 = QPainterPath(); path1.addRect(QRectF(-10, -10, 40, 10));
path2 = QPainterPath(); path2.addRect(QRectF(-10, 10, 40, 10));
@@ -983,7 +983,7 @@ void tst_QGraphicsScene::selectionChanged()
rect->setSelected(true);
QVERIFY(rect->isSelected());
QCOMPARE(spy.count(), 1); // selection changed
- QCOMPARE(scene.selectedItems(), QList<QGraphicsItem *>() << rect);
+ QCOMPARE(scene.selectedItems(), {rect});
rect->setSelected(false);
QVERIFY(!rect->isSelected());
@@ -3889,6 +3889,14 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
tester1->eventTypes.clear();
tester2->eventTypes.clear();
+ const QEvent::Type initialExpected[] =
+ {QEvent::GraphicsSceneHoverEnter, QEvent::GraphicsSceneHoverMove, QEvent::GrabMouse,
+ QEvent::GraphicsSceneMousePress, QEvent::UngrabMouse};
+
+ const QEvent::Type repeatExpected[] =
+ {QEvent::GraphicsSceneHoverMove, QEvent::GrabMouse, QEvent::GraphicsSceneMousePress,
+ QEvent::UngrabMouse};
+
{
QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress);
me.setButton(Qt::LeftButton);
@@ -3897,16 +3905,11 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
me2.setButton(Qt::LeftButton);
QCoreApplication::sendEvent(&scene, &me);
QCoreApplication::sendEvent(&scene, &me2);
- QCOMPARE(tester1->eventTypes,
- QList<QEvent::Type>() << QEvent::GraphicsSceneHoverEnter
- << QEvent::GraphicsSceneHoverMove << QEvent::GrabMouse
- << QEvent::GraphicsSceneMousePress << QEvent::UngrabMouse);
+ QCOMPARE(tester1->eventTypes, initialExpected);
tester1->eventTypes.clear();
QCoreApplication::sendEvent(&scene, &me);
QCoreApplication::sendEvent(&scene, &me2);
- QCOMPARE(tester1->eventTypes,
- QList<QEvent::Type>() << QEvent::GraphicsSceneHoverMove << QEvent::GrabMouse
- << QEvent::GraphicsSceneMousePress << QEvent::UngrabMouse);
+ QCOMPARE(tester1->eventTypes, repeatExpected);
}
{
QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress);
@@ -3920,17 +3923,12 @@ void tst_QGraphicsScene::dispatchHoverOnPress()
QCoreApplication::sendEvent(&scene, &me);
QCoreApplication::sendEvent(&scene, &me2);
qCDebug(lcTests) << tester1->eventTypes;
- QCOMPARE(tester1->eventTypes, QList<QEvent::Type>() << QEvent::GraphicsSceneHoverLeave);
- QCOMPARE(tester2->eventTypes,
- QList<QEvent::Type>() << QEvent::GraphicsSceneHoverEnter
- << QEvent::GraphicsSceneHoverMove << QEvent::GrabMouse
- << QEvent::GraphicsSceneMousePress << QEvent::UngrabMouse);
+ QCOMPARE(tester1->eventTypes, {QEvent::GraphicsSceneHoverLeave});
+ QCOMPARE(tester2->eventTypes, initialExpected);
tester2->eventTypes.clear();
QCoreApplication::sendEvent(&scene, &me);
QCoreApplication::sendEvent(&scene, &me2);
- QCOMPARE(tester2->eventTypes,
- QList<QEvent::Type>() << QEvent::GraphicsSceneHoverMove << QEvent::GrabMouse
- << QEvent::GraphicsSceneMousePress << QEvent::UngrabMouse);
+ QCOMPARE(tester2->eventTypes, repeatExpected);
}
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 2dddcbe31e..84841428f0 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -948,7 +948,7 @@ void tst_QGraphicsView::rubberBandSelectionMode()
sendMousePress(view.viewport(), QPoint(), Qt::LeftButton);
sendMouseMove(view.viewport(), view.viewport()->rect().center(),
Qt::LeftButton, Qt::LeftButton);
- QCOMPARE(scene.selectedItems(), QList<QGraphicsItem *>() << rect);
+ QCOMPARE(scene.selectedItems(), {rect});
sendMouseRelease(view.viewport(), QPoint(), Qt::LeftButton);
view.setRubberBandSelectionMode(Qt::ContainsItemShape);
@@ -960,7 +960,7 @@ void tst_QGraphicsView::rubberBandSelectionMode()
QVERIFY(scene.selectedItems().isEmpty());
sendMouseMove(view.viewport(), view.viewport()->rect().bottomRight(),
Qt::LeftButton, Qt::LeftButton);
- QCOMPARE(scene.selectedItems(), QList<QGraphicsItem *>() << rect);
+ QCOMPARE(scene.selectedItems(), {rect});
}
void tst_QGraphicsView::rubberBandExtendSelection()
@@ -990,7 +990,7 @@ void tst_QGraphicsView::rubberBandExtendSelection()
// select first item
item1->setSelected(true);
- QCOMPARE(scene.selectedItems(), QList<QGraphicsItem *>() << item1);
+ QCOMPARE(scene.selectedItems(), {item1});
// first rubberband without modifier key
sendMousePress(view.viewport(), view.mapFromScene(20, 115), Qt::LeftButton);