diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-04 10:32:24 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-04-04 16:52:39 (GMT) |
commit | 66a7e4361f9f07962c7d22409aa6274da2dce9de (patch) | |
tree | d99c66e9e9563440ddbec11803ed2df8d13ecf5a /tests/auto/qstringlist | |
parent | 153bf90ea0fc5f58c27c82e13dc1c4d73b028f5e (diff) | |
download | Qt-66a7e4361f9f07962c7d22409aa6274da2dce9de.zip Qt-66a7e4361f9f07962c7d22409aa6274da2dce9de.tar.gz Qt-66a7e4361f9f07962c7d22409aa6274da2dce9de.tar.bz2 |
QStringList: constructor for std::initializer_list
Reviewed-by: Joao
Diffstat (limited to 'tests/auto/qstringlist')
-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" |