diff --git a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp index 1d30ca3d035..3631f4f977c 100644 --- a/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp +++ b/tests/auto/corelib/tools/qvarlengtharray/tst_qvarlengtharray.cpp @@ -68,6 +68,8 @@ class tst_QVarLengthArray : public QObject { Q_OBJECT private slots: + void defaultConstructor_int() { defaultConstructor(); } + void defaultConstructor_QString() { defaultConstructor(); } void append(); void prepend(); void emplace(); @@ -112,6 +114,8 @@ private slots: void erase(); private: + template + void defaultConstructor(); template void move(T t1, T t2); template @@ -124,6 +128,23 @@ private: void initializeList(); }; +template +void tst_QVarLengthArray::defaultConstructor() +{ + { + QVarLengthArray vla; + QCOMPARE(vla.size(), 0); + QVERIFY(vla.empty()); + QVERIFY(vla.isEmpty()); + QCOMPARE(vla.begin(), vla.end()); + QCOMPARE(vla.capacity(), 123); + } + { + QVarLengthArray vla; + QCOMPARE(vla.capacity(), 256); // notice, should we change the default + } +} + void tst_QVarLengthArray::append() { QVarLengthArray v;