summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2014-06-21 11:27:01 +0200
committerMitch Curtis <mitch.curtis@digia.com>2014-06-23 11:19:07 +0200
commitffdba0459b9ca562d530849e3e8995d6f17985df (patch)
tree0f0f7673d3b664c980d5b29c999c0a7f398955f6
parent0f2ed80a0cfd0442fd5ea1fc1fd4a76ffb8a162a (diff)
Correct grammar of missing Q_OBJECT macro warning.
Change-Id: Ifb84220285e38ce6940595035ca9fe012c350b79 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r--src/tools/moc/moc.cpp2
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index ea4838c8f2..f5700899fa 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -788,7 +788,7 @@ void Moc::parse()
if (!def.hasQObject && !def.hasQGadget)
- error("Class declarations lacks Q_OBJECT macro.");
+ error("Class declaration lacks Q_OBJECT macro.");
// Add meta tags to the plugin meta data:
if (!def.pluginData.iid.isEmpty())
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 04140fa4a1..2e1504383f 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -1828,6 +1828,12 @@ void tst_Moc::warnings_data()
<< QString("IGNORE_ALL_STDOUT")
<< QString(":3: Warning: Macro argument mismatch.\n:4: Warning: Macro argument mismatch.");
+ QTest::newRow("Class declaration lacks Q_OBJECT macro.")
+ << QByteArray("class X : public QObject \n { \n public slots: \n void foo() {} \n };")
+ << QStringList()
+ << 1
+ << QString()
+ << QString("standard input:5: Error: Class declaration lacks Q_OBJECT macro.");
}
void tst_Moc::warnings()