summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2014-07-10 02:39:37 +0200
committerAleix Pol Gonzalez <aleixpol@kde.org>2014-07-10 16:10:59 +0200
commit52eccc6cfa0f3b3649d60e3173382cdb68828f44 (patch)
treefc73ee3969a9601faaad37bbb0a2309f23a78c73 /tests
parent0af228700e85167b9406193a38ea27584c6dc4d7 (diff)
Introduce a new warning in moc, to notify about duplicated properties
At the moment, it's possible to have 2 properties with the same name, which doesn't make much sense. Notify the user about that so she can react on it. Change-Id: I4865b71730921b79ce9dd8abb0cc760b3f1dbfd8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 9a737ef96b..97a2f366c5 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1792,6 +1792,14 @@ void tst_Moc::warnings_data()
<< QString("IGNORE_ALL_STDOUT")
<< QString("standard input:1: Warning: Property declaration x has no READ accessor function or associated MEMBER variable. The property will be invalid.");
+ // This should output a warning
+ QTest::newRow("Duplicate property warning")
+ << QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x READ x) Q_PROPERTY(int x READ y) };")
+ << QStringList()
+ << 0
+ << QString("IGNORE_ALL_STDOUT")
+ << QString("standard input:1: Warning: The property 'x' is defined multiple times in class X.");
+
// Passing "-nn" should NOT suppress the warning
QTest::newRow("Invalid property warning with -nn")
<< QByteArray("class X : public QObject { Q_OBJECT Q_PROPERTY(int x) };")