summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qvector/tst_qvector.cpp
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-11-06 09:19:29 +0100
committerhjk <hjk121@nokiamail.com>2014-11-06 11:33:52 +0100
commitd3f3e1218c07cad7f69eebe9b011bededb45bfa5 (patch)
tree155d0289dfde0d3cc3ca961f329503a66935edae /tests/auto/corelib/tools/qvector/tst_qvector.cpp
parent1031ad876142461c0256fc78648747171c1b48db (diff)
Add a inline QVector::append(const QVector &) overload
This is present in QList already and its lack is a nuisance when switching from QList based code to QVector (which makes sense e.g. if the item size exceeds sizeof(void*)) Also, albeit operator+=() and operator<<() exist, some people simply prefer functions with real function names. [ChangeLog][QtCore][QVector] Added QVector::append(const QVector &) overload Change-Id: I9aae8223b086765625f2f3071fab5da0780f8a43 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/corelib/tools/qvector/tst_qvector.cpp')
-rw-r--r--tests/auto/corelib/tools/qvector/tst_qvector.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qvector/tst_qvector.cpp b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
index 9a79d48472..c9e8a5f657 100644
--- a/tests/auto/corelib/tools/qvector/tst_qvector.cpp
+++ b/tests/auto/corelib/tools/qvector/tst_qvector.cpp
@@ -575,6 +575,18 @@ void tst_QVector::append() const
QCOMPARE(v.last(), SimpleValue<T>::at(0));
}
#endif
+ {
+ QVector<int> v;
+ v << 1 << 2 << 3;
+ QVector<int> x;
+ x << 4 << 5 << 6;
+ v.append(x);
+
+ QVector<int> combined;
+ combined << 1 << 2 << 3 << 4 << 5 << 6;
+
+ QCOMPARE(v, combined);
+ }
}
void tst_QVector::appendInt() const