diff options
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 752c539964..10c6a3ebc9 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -313,6 +313,14 @@ public slots: { } }; +#define CLASSINFO_VAARGS(...) Q_CLASSINFO("classinfo_va_args", #__VA_ARGS__) +class TestClassinfoFromVaArgs : public QObject +{ + Q_OBJECT + CLASSINFO_VAARGS(a, b, c, d) +}; +#undef CLASSINFO_VAARGS + struct ForwardDeclaredStruct; struct StructQObject : public QObject @@ -655,6 +663,7 @@ private slots: void task87883(); void multilineComments(); void classinfoWithEscapes(); + void classinfoFromVaArgs(); void trNoopInClassInfo(); void ppExpressionEvaluation(); void arrayArguments(); @@ -977,6 +986,15 @@ void tst_Moc::classinfoWithEscapes() QCOMPARE(mm.methodSignature(), QByteArray("slotWithAReallyLongName(int)")); } +void tst_Moc::classinfoFromVaArgs() +{ + const QMetaObject *mobj = &TestClassinfoFromVaArgs::staticMetaObject; + + QCOMPARE(mobj->classInfoCount(), 1); + QCOMPARE(mobj->classInfo(0).name(), "classinfo_va_args"); + QCOMPARE(mobj->classInfo(0).value(), "a,b,c,d"); +} + void tst_Moc::trNoopInClassInfo() { TestClass t; |