summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-06-22 15:34:48 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-06-25 10:14:24 +0200
commite721ec269e972ea2754cb9bd27fb73b72ed53c7b (patch)
treeb09bb4ca8fe18d528a0a88cb310ecd1f8dc9216f /tests
parentb62f32a4dd87010e4c51d33ef440e2fbba531361 (diff)
Use QList instead of QVector in other tests
Task-number: QTBUG-84469 Change-Id: I656c9f73bd2364be39ee67747524e7c4a25c0935 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/other/compiler/tst_compiler.cpp27
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp2
-rw-r--r--tests/auto/other/lancelot/paintcommands.h8
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp11
-rw-r--r--tests/auto/other/qcomplextext/tst_qcomplextext.cpp11
5 files changed, 25 insertions, 34 deletions
diff --git a/tests/auto/other/compiler/tst_compiler.cpp b/tests/auto/other/compiler/tst_compiler.cpp
index 4d19debd06..435bd42faf 100644
--- a/tests/auto/other/compiler/tst_compiler.cpp
+++ b/tests/auto/other/compiler/tst_compiler.cpp
@@ -58,7 +58,6 @@ private slots:
void detectEnums();
void overrideCFunction();
void stdSortQList();
- void stdSortQVector();
void templateCallOrder();
void virtualFunctionNoLongerPureVirtual();
void charSignedness() const;
@@ -422,21 +421,6 @@ void tst_Compiler::stdSortQList()
QCOMPARE(slist.value(0), QString("a"));
QCOMPARE(slist.value(1), QString("b"));
}
-
-void tst_Compiler::stdSortQVector()
-{
- QVector<int> vector;
- vector << 4 << 2;
- std::sort(vector.begin(), vector.end());
- QCOMPARE(vector.value(0), 2);
- QCOMPARE(vector.value(1), 4);
-
- QVector<QString> strvec;
- strvec << "b" << "a";
- std::sort(strvec.begin(), strvec.end());
- QCOMPARE(strvec.value(0), QString("a"));
- QCOMPARE(strvec.value(1), QString("b"));
-}
#else
void tst_Compiler::stdSortQList()
{ QSKIP("Compiler's STL broken"); }
@@ -1063,15 +1047,16 @@ void tst_Compiler::cxx11_nullptr()
namespace SomeNamespace {
class AdlOnly {
- QVector<int> v;
+ QList<int> v;
+
public:
AdlOnly() : v(5) { std::fill_n(v.begin(), v.size(), 42); }
private:
- friend QVector<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); }
- friend QVector<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); }
- friend QVector<int>::iterator begin(AdlOnly &x) { return x.v.begin(); }
- friend QVector<int>::iterator end(AdlOnly &x) { return x.v.end(); }
+ friend QList<int>::const_iterator begin(const AdlOnly &x) { return x.v.begin(); }
+ friend QList<int>::const_iterator end(const AdlOnly &x) { return x.v.end(); }
+ friend QList<int>::iterator begin(AdlOnly &x) { return x.v.begin(); }
+ friend QList<int>::iterator end(AdlOnly &x) { return x.v.end(); }
};
}
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 2f6bd2872f..f2839d57e1 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -2733,7 +2733,7 @@ void PaintCommands::command_pen_setDashPattern(QRegularExpressionMatch re)
QString cap = caps.at(1);
QStringList numbers = cap.split(separators, Qt::SkipEmptyParts);
- QVector<qreal> pattern;
+ QList<qreal> pattern;
for (int i=0; i<numbers.size(); ++i)
pattern.append(convertToDouble(numbers.at(i)));
diff --git a/tests/auto/other/lancelot/paintcommands.h b/tests/auto/other/lancelot/paintcommands.h
index 6085b9c088..e9468b1f42 100644
--- a/tests/auto/other/lancelot/paintcommands.h
+++ b/tests/auto/other/lancelot/paintcommands.h
@@ -109,7 +109,11 @@ public:
void setPainter(QPainter *pt) { staticInit(); m_painter = pt; }
void setType(DeviceType t) { staticInit(); m_type = t; }
void setFilePath(const QString &path) { staticInit(); m_filepath = path; }
- void setControlPoints(const QVector<QPointF> &points) { staticInit(); m_controlPoints = points; }
+ void setControlPoints(const QList<QPointF> &points)
+ {
+ staticInit();
+ m_controlPoints = points;
+ }
void setVerboseMode(bool v) { staticInit(); m_verboseMode = v; }
void insertAt(int commandIndex, const QStringList &newCommands);
void setShouldDrawText(bool drawText) { m_shouldDrawText = drawText; }
@@ -279,7 +283,7 @@ private:
bool m_checkers_background;
bool m_shouldDrawText;
- QVector<QPointF> m_controlPoints;
+ QList<QPointF> m_controlPoints;
#ifndef QT_NO_OPENGL
QOpenGLContext *m_default_glcontext;
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 07cccde0c8..b3ac7489b7 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -2499,7 +2499,8 @@ void tst_QAccessibility::groupBoxTest()
QCOMPARE(iface->role(), QAccessible::Grouping);
QCOMPARE(iface->text(QAccessible::Name), QLatin1String("Test QGroupBox"));
QCOMPARE(iface->text(QAccessible::Description), QLatin1String("This group box will be used to test accessibility"));
- QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > relations = rButtonIface->relations();
+ QList<QPair<QAccessibleInterface *, QAccessible::Relation>> relations =
+ rButtonIface->relations();
QCOMPARE(relations.size(), 1);
QPair<QAccessibleInterface*, QAccessible::Relation> relation = relations.first();
QCOMPARE(relation.first->object(), groupBox);
@@ -2572,7 +2573,7 @@ void tst_QAccessibility::dialogButtonBoxTest()
child = iface->child(0);
QCOMPARE(child->role(), QAccessible::PushButton);
- QVector<QAccessibleInterface *> buttons;
+ QList<QAccessibleInterface *> buttons;
for (int i = 0; i < iface->childCount(); ++i)
buttons << iface->child(i);
@@ -2624,7 +2625,7 @@ void tst_QAccessibility::dialogButtonBoxTest()
QApplication::processEvents();
QStringList actualOrder;
- QVector<QAccessibleInterface *> buttons;
+ QList<QAccessibleInterface *> buttons;
for (int i = 0; i < iface->childCount(); ++i)
buttons << iface->child(i);
@@ -3672,7 +3673,7 @@ void tst_QAccessibility::labelTest()
QCOMPARE(acc_label->state().focusable, false);
QCOMPARE(acc_label->state().readOnly, true);
- QVector<QPair<QAccessibleInterface *, QAccessible::Relation> > rels = acc_label->relations();
+ QList<QPair<QAccessibleInterface *, QAccessible::Relation>> rels = acc_label->relations();
QCOMPARE(rels.count(), 1);
QAccessibleInterface *iface = rels.first().first;
QAccessible::Relation rel = rels.first().second;
@@ -4014,7 +4015,7 @@ public:
}
private:
- QVector<QAccessibleInterface *> m_children;
+ QList<QAccessibleInterface *> m_children;
};
void tst_QAccessibility::focusChild()
diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
index 9ca61a69b4..1ba211aa0a 100644
--- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
+++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp
@@ -288,7 +288,8 @@ void tst_QComplexText::bidiCursor_PDF()
QVERIFY(line.cursorToX(size) == line.cursorToX(size - 1));
}
-static void testBidiString(const QString &data, int paragraphDirection, const QVector<int> &resolvedLevels, const QVector<int> &visualOrder)
+static void testBidiString(const QString &data, int paragraphDirection,
+ const QList<int> &resolvedLevels, const QList<int> &visualOrder)
{
Q_UNUSED(resolvedLevels);
@@ -398,7 +399,7 @@ void tst_QComplexText::bidiCharacterTest()
int paragraphDirection = parts.at(1).toInt();
// int resolvedParagraphLevel = parts.at(2).toInt();
- QVector<int> resolvedLevels;
+ QList<int> resolvedLevels;
QList<QByteArray> levelParts = parts.at(3).split(' ');
for (const auto &p : levelParts) {
if (p == "x") {
@@ -410,7 +411,7 @@ void tst_QComplexText::bidiCharacterTest()
}
}
- QVector<int> visualOrder;
+ QList<int> visualOrder;
QList<QByteArray> orderParts = parts.at(4).split(' ');
for (const auto &p : orderParts) {
bool ok;
@@ -470,8 +471,8 @@ void tst_QComplexText::bidiTest()
f.open(QIODevice::ReadOnly);
int linenum = 0;
- QVector<int> resolvedLevels;
- QVector<int> visualOrder;
+ QList<int> resolvedLevels;
+ QList<int> visualOrder;
while (!f.atEnd()) {
linenum++;