summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/tst_moc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index d4dfe54ab0..04140fa4a1 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -131,6 +131,7 @@ public:
emit send(value);
}
+ bool operator< ( const Sender & ) const { /* QTBUG-36834 */ return true;}
signals:
void send(const String::Type&);
void send(const Int::Type&);
@@ -1546,13 +1547,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
};
@@ -1560,6 +1578,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()