diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-04 02:48:13 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-04 02:48:13 (GMT) |
commit | 238833271bf1792c0906b632b165bedf106b5f92 (patch) | |
tree | 27134d4c99d44d7b8769c1fd42b95a24b1cb1fc1 /tests/auto/moc | |
parent | c968e6602aef04aba4b68af205cd29ad18e0a823 (diff) | |
parent | 8190ee79bdaebd8aaa985442c60268c1fcabe719 (diff) | |
download | Qt-238833271bf1792c0906b632b165bedf106b5f92.zip Qt-238833271bf1792c0906b632b165bedf106b5f92.tar.gz Qt-238833271bf1792c0906b632b165bedf106b5f92.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: (40 commits)
Readded a ';;' that was removed by mistake.
Fixed mkspec detection for Symbian.
Removed javascript-jit from default symbian-gcce build.
QAbstractSocket: Check for socket state on Unbuffered reads
Corrected a mismerge in GCCE link parameters.
QAbstractSocket: Check for engine validity on Unbuffered reads
tst_qnetworkreply: fix the MiniHttpServer.
tst_qnetworkProxyFactory: fix debug output.
Fixed incorrect referral to an include file.
tst_qnetworkreply: getErrors() only ignore warning for the specific test
Check engine existence before increasing reference count
Fixed library casing.
Fix Q_INVOKABLE declared after Q_PROPERTY
tst_qnetworkreply: small improvements
QNAM: Add a warning for misuse of the file backend.
Keep reference count for cached font engines in QTextEngine
QNAM HTTP: Be more strict with HTTP channel state
tst_qnetworkreply: Add a test for broken gzip encoding
QNAM HTTP: Add qWarning() for double-finished() bug
fix documentation typos in isLowSurrogate and requiresSurrogates
...
Diffstat (limited to 'tests/auto/moc')
-rw-r--r-- | tests/auto/moc/tst_moc.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 56a3107..203f0ae 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -493,6 +493,7 @@ private slots: void QTBUG5590_dummyProperty(); void QTBUG12260_defaultTemplate(); void notifyError(); + void QTBUG17635_invokableAndProperty(); void revisions(); void warnings_data(); void warnings(); @@ -1390,6 +1391,31 @@ void tst_Moc::notifyError() #endif } +class QTBUG_17635_InvokableAndProperty : public QObject +{ + Q_OBJECT +public: + Q_PROPERTY(int numberOfEggs READ numberOfEggs) + Q_PROPERTY(int numberOfChickens READ numberOfChickens) + Q_INVOKABLE QString getEgg(int index) { return QString::fromLatin1("Egg"); } + Q_INVOKABLE QString getChicken(int index) { return QString::fromLatin1("Chicken"); } + int numberOfEggs() { return 2; } + int numberOfChickens() { return 4; } +}; + +void tst_Moc::QTBUG17635_invokableAndProperty() +{ + //Moc used to fail parsing Q_INVOKABLE if they were dirrectly following a Q_PROPERTY; + QTBUG_17635_InvokableAndProperty mc; + QString val; + QMetaObject::invokeMethod(&mc, "getEgg", Q_RETURN_ARG(QString, val), Q_ARG(int, 10)); + QCOMPARE(val, QString::fromLatin1("Egg")); + QMetaObject::invokeMethod(&mc, "getChicken", Q_RETURN_ARG(QString, val), Q_ARG(int, 10)); + QCOMPARE(val, QString::fromLatin1("Chicken")); + QVERIFY(mc.metaObject()->indexOfProperty("numberOfEggs") != -1); + QVERIFY(mc.metaObject()->indexOfProperty("numberOfChickens") != -1); +} + // If changed, update VersionTestNotify below class VersionTest : public QObject { |