summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 8ce55cbdf5..e26b02a560 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1538,13 +1538,30 @@ class QTBUG12260_defaultTemplate_Object : public QObject
public slots:
#if !(defined(Q_CC_GNU) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) || defined(Q_MOC_RUN)
void doSomething(QHash<QString, QVariant> values = QHash<QString, QVariant>() ) { Q_UNUSED(values); }
+ void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val
+ = QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >() )
+ { Q_UNUSED(val); }
#else
// we want to test the previous function, but gcc < 4.4 seemed to have a bug similar to the one moc has.
typedef QHash<QString, QVariant> WorkaroundGCCBug;
void doSomething(QHash<QString, QVariant> values = WorkaroundGCCBug() ) { Q_UNUSED(values); }
+ void doSomethingElse(QSharedPointer<QVarLengthArray<QString, (16 >> 2)> > val
+ = (QSharedPointer<QVarLengthArray<QString, (16 >> 2)> >()) )
+ { Q_UNUSED(val); }
#endif
void doAnotherThing(bool a = (1 < 3), bool b = (1 > 4)) { Q_UNUSED(a); Q_UNUSED(b); }
+
+#if defined(Q_MOC_RUN) || (defined(Q_COMPILER_AUTO_TYPE) && !(defined(Q_CC_CLANG) && (__clang_major__ * 100) + __clang_minor__) < 304)
+ // There is no Q_COMPILER_>> but if compiler support auto, it should also support >>
+ void performSomething(QVector<QList<QString>> e = QVector<QList<QString>>(8 < 1),
+ QHash<int, QVector<QString>> h = QHash<int, QVector<QString>>())
+ { Q_UNUSED(e); Q_UNUSED(h); }
+#else
+ void performSomething(QVector<QList<QString> > e = QVector<QList<QString> >(),
+ QHash<int, QVector<QString> > h = (QHash<int, QVector<QString> >()))
+ { Q_UNUSED(e); Q_UNUSED(h); }
+#endif
};
@@ -1552,6 +1569,8 @@ void tst_Moc::QTBUG12260_defaultTemplate()
{
QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomething(QHash<QString,QVariant>)") != -1);
QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
+ QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doSomethingElse(QSharedPointer<QVarLengthArray<QString,(16>>2)> >)") != -1);
+ QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("performSomething(QVector<QList<QString> >,QHash<int,QVector<QString> >)") != -1);
}
void tst_Moc::notifyError()