summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/tst_moc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index fb30d66e6ec..7001d676878 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -2576,6 +2576,26 @@ void tst_Moc::warnings_data()
<< QString()
<< u"standard input:2:1: error: Parse error at \"NONSENSE\""_s;
+ QTest::newRow("VIRTUAL FINAL property")
+ << "class X { \n Q_PROPERTY(int p READ p VIRTUAL FINAL) \n };"_ba << QStringList() << 1
+ << QString()
+ << u"standard input:2:1: error: Issue with property declaration p: "
+ u"The VIRTUAL cannot be combined with FINAL, as these attributes are mutually exclusive"_s;
+
+ QTest::newRow("FINAL OVERRIDE property")
+ << "class X { \n Q_PROPERTY(int p READ p FINAL OVERRIDE) \n };"_ba << QStringList() << 1
+ << QString()
+ << u"standard input:2:1: error: Issue with property declaration p: "
+ u"OVERRIDE is redundant when property is marked FINAL"_s;
+
+ QTest::newRow("VIRTUAL OVERRIDE property")
+ << "class X { \n Q_PROPERTY(int p READ p VIRTUAL OVERRIDE) \n };"_ba << QStringList()
+ << 1 << QString()
+ << u"standard input:2:1: error: Issue with property declaration p: VIRTUAL is "
+ u"redundant when overriding a property."
+ u" The OVERRIDE must only be used when actually overriding an existing property;"
+ u" using it on a new property is an error."_s;
+
#ifdef Q_OS_UNIX // Limit to Unix because the error message is platform-dependent
QTest::newRow("Q_PLUGIN_METADATA: unreadable file")
<< QByteArray("class X { \n Q_PLUGIN_METADATA(FILE \".\") \n };")