summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-10-23 14:01:35 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-10-23 14:45:03 +0200
commit790aef362fd195adf97d8c780a7cbbbade27d51f (patch)
tree8be464687ab21806cfe9f7ada27098b563aa41b2 /tests/auto/tools
parent9720efbd1035c2e939b0581163e6d804c713dd96 (diff)
parent07475c662eb73c833da2d461b8ef2702ca1e2cfb (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts: .qmake.conf configure src/corelib/global/qglobal.h src/tools/qdoc/node.cpp src/tools/qdoc/qdocdatabase.cpp tests/auto/corelib/io/qsettings/tst_qsettings.cpp tools/configure/configureapp.cpp Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
Diffstat (limited to 'tests/auto/tools')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index fa1b68b4f9..c113b7cd60 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -513,6 +513,8 @@ class tst_Moc : public QObject
Q_PROPERTY(QString member4 MEMBER sMember NOTIFY member4Changed)
Q_PROPERTY(QString member5 MEMBER sMember NOTIFY member5Changed)
Q_PROPERTY(QString member6 MEMBER sConst CONSTANT)
+ Q_PROPERTY(QString sub1 MEMBER (sub.m_string))
+ Q_PROPERTY(QString sub2 READ (sub.string) WRITE (sub.setString))
public:
inline tst_Moc() : sConst("const") {}
@@ -626,6 +628,13 @@ private:
QString sMember;
const QString sConst;
PrivatePropertyTest *pPPTest;
+
+ struct {
+ QString m_string;
+ void setString(const QString &s) { m_string = s; }
+ QString string() { return m_string; }
+ } sub;
+
};
void tst_Moc::initTestCase()
@@ -1883,12 +1892,19 @@ void tst_Moc::warnings_data()
<< QString()
<< QString("standard input:5: Error: Class declaration lacks Q_OBJECT macro.");
- QTest::newRow("QTBUG-46210: crash on invalid macro")
- << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45);")
+ QTest::newRow("Invalid macro definition")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c #d\n Foo(45, 42, 39);")
<< QStringList()
<< 1
<< QString("IGNORE_ALL_STDOUT")
<< QString(":2: Error: '#' is not followed by a macro parameter");
+
+ QTest::newRow("QTBUG-46210: crash on invalid macro invocation")
+ << QByteArray("#define Foo(a, b, c) a b c #a #b #c a##b##c\n Foo(45);")
+ << QStringList()
+ << 1
+ << QString("IGNORE_ALL_STDOUT")
+ << QString(":2: Error: Macro invoked with too few parameters for a use of '#'");
}
void tst_Moc::warnings()
@@ -2037,6 +2053,10 @@ void tst_Moc::memberProperties_data()
<< 1 << "blub5" << "blub5Changed(const QString&)" << "mno" << true << "mno";
QTest::newRow("private MEMBER property with CONSTANT")
<< 1 << "blub6" << "" << "test" << false << "const";
+ QTest::newRow("sub1")
+ << 0 << "sub1" << "" << "helloSub1" << true << "helloSub1";
+ QTest::newRow("sub2")
+ << 0 << "sub2" << "" << "helloSub2" << true << "helloSub2";
}
void tst_Moc::memberProperties()