diff options
Diffstat (limited to 'tests/auto/qvector')
-rw-r--r-- | tests/auto/qvector/tst_qvector.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qvector/tst_qvector.cpp b/tests/auto/qvector/tst_qvector.cpp index a04ce60..b3decc8 100644 --- a/tests/auto/qvector/tst_qvector.cpp +++ b/tests/auto/qvector/tst_qvector.cpp @@ -80,6 +80,7 @@ private slots: void remove() const; void size() const; void startsWith() const; + void swap() const; void toList() const; void toStdVector() const; void value() const; @@ -579,6 +580,17 @@ void tst_QVector::startsWith() const QVERIFY(myvec.startsWith(1)); } +void tst_QVector::swap() const +{ + QVector<int> v1, v2; + v1 << 1 << 2 << 3; + v2 << 4 << 5 << 6; + + v1.swap(v2); + QCOMPARE(v1,QVector<int>() << 4 << 5 << 6); + QCOMPARE(v2,QVector<int>() << 1 << 2 << 3); +} + void tst_QVector::toList() const { QVector<QString> myvec; |