diff options
Diffstat (limited to 'tests/auto/qstringlist/tst_qstringlist.cpp')
-rw-r--r-- | tests/auto/qstringlist/tst_qstringlist.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qstringlist/tst_qstringlist.cpp b/tests/auto/qstringlist/tst_qstringlist.cpp index 283c17f..d8db00a 100644 --- a/tests/auto/qstringlist/tst_qstringlist.cpp +++ b/tests/auto/qstringlist/tst_qstringlist.cpp @@ -78,6 +78,8 @@ private slots: void join() const; void join_data() const; void joinEmptiness() const; + + void initializeList() const; }; extern const char email[]; @@ -321,5 +323,16 @@ void tst_QStringList::joinEmptiness() const QVERIFY(string.isNull()); } +void tst_QStringList::initializeList() const +{ +#ifdef Q_COMPILER_INITIALIZER_LISTS + QStringList v1{QLatin1String("hello"),"world",QString::fromLatin1("plop")}; + QCOMPARE(v1, (QStringList() << "hello" << "world" << "plop")); + QCOMPARE(v1, (QStringList{"hello","world","plop"})); +#else + QSKIP("Require C++0x support, pass the right flag to the compiler", SkipAll); +#endif +} + QTEST_APPLESS_MAIN(tst_QStringList) #include "tst_qstringlist.moc" |