diff options
| author | Liang Qi <liang.qi@qt.io> | 2017-03-02 09:04:38 +0100 |
|---|---|---|
| committer | Liang Qi <liang.qi@qt.io> | 2017-03-02 09:04:38 +0100 |
| commit | 71264bae08d81bdeceb96133fdb01c370504dfcc (patch) | |
| tree | d5dadaac8209d5ef1857a4d65197b9ee12b39848 /tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp | |
| parent | 5e785c0b83c9908c665f253c131629ac325a21f5 (diff) | |
| parent | 6d10f739cd750968d0dd0e9d8fa4b64353a86c6c (diff) | |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
Diffstat (limited to 'tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp')
| -rw-r--r-- | tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp index 25ac952396b..96656a6dff5 100644 --- a/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp +++ b/tests/auto/concurrent/qtconcurrentmap/tst_qtconcurrentmap.cpp @@ -48,6 +48,7 @@ private slots: void blocking_mappedReduced(); void assignResult(); void functionOverloads(); + void noExceptFunctionOverloads(); #ifndef QT_NO_EXCEPTIONS void exceptions(); #endif @@ -2025,6 +2026,16 @@ int fn(int &i) return i; } +int fnConstNoExcept(const int &i) Q_DECL_NOTHROW +{ + return i; +} + +int fnNoExcept(int &i) Q_DECL_NOTHROW +{ + return i; +} + QString changeTypeConst(const int &) { return QString(); @@ -2035,6 +2046,16 @@ QString changeType(int &) return QString(); } +QString changeTypeConstNoExcept(const int &) Q_DECL_NOTHROW +{ + return QString(); +} + +QString changeTypeNoExcept(int &) Q_DECL_NOTHROW +{ + return QString(); +} + int changeTypeQStringListConst(const QStringList &) { return 0; @@ -2045,6 +2066,16 @@ int changeTypeQStringList(QStringList &) return 0; } +int changeTypeQStringListConstNoExcept(const QStringList &) Q_DECL_NOTHROW +{ + return 0; +} + +int changeTypeQStringListNoExcept(QStringList &) Q_DECL_NOTHROW +{ + return 0; +} + class MemFnTester { public: @@ -2069,6 +2100,26 @@ public: { return QString(); } + + MemFnTester fnNoExcept() Q_DECL_NOTHROW + { + return MemFnTester(); + } + + MemFnTester fnConstNoExcept() const Q_DECL_NOTHROW + { + return MemFnTester(); + } + + QString changeTypeNoExcept() Q_DECL_NOTHROW + { + return QString(); + } + + QString changeTypeConstNoExcept() const Q_DECL_NOTHROW + { + return QString(); + } }; Q_DECLARE_METATYPE(QVector<MemFnTester>); @@ -2097,6 +2148,29 @@ void tst_QtConcurrentMap::functionOverloads() QtConcurrent::blockingMapped<QList<QString> >(constMemFnTesterList, &MemFnTester::changeTypeConst); } +void tst_QtConcurrentMap::noExceptFunctionOverloads() +{ + QList<int> intList; + const QList<int> constIntList; + QList<MemFnTester> classList; + const QList<MemFnTester> constMemFnTesterList; + + QtConcurrent::mapped(intList, fnConstNoExcept); + QtConcurrent::mapped(constIntList, fnConstNoExcept); + QtConcurrent::mapped(classList, &MemFnTester::fnConstNoExcept); + QtConcurrent::mapped(constMemFnTesterList, &MemFnTester::fnConstNoExcept); + + QtConcurrent::blockingMapped<QVector<int> >(intList, fnConstNoExcept); + QtConcurrent::blockingMapped<QVector<int> >(constIntList, fnConstNoExcept); + QtConcurrent::blockingMapped<QVector<MemFnTester> >(classList, &MemFnTester::fnConstNoExcept); + QtConcurrent::blockingMapped<QVector<MemFnTester> >(constMemFnTesterList, &MemFnTester::fnConstNoExcept); + + QtConcurrent::blockingMapped<QList<QString> >(intList, changeTypeConstNoExcept); + QtConcurrent::blockingMapped<QList<QString> >(constIntList, changeTypeConstNoExcept); + QtConcurrent::blockingMapped<QList<QString> >(classList, &MemFnTester::changeTypeConstNoExcept); + QtConcurrent::blockingMapped<QList<QString> >(constMemFnTesterList, &MemFnTester::changeTypeConstNoExcept); +} + QAtomicInt currentInstanceCount; QAtomicInt peakInstanceCount; class InstanceCounter |
