summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2016-09-10 14:23:39 +0200
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2016-09-16 07:47:29 +0000
commit97710f429fb06914b5cb86fdd3aa333eb8a90dff (patch)
treef1c78e15ae2c5c15539d6bf0c3371a8a6ec2019e /tests/auto
parent001efe14f2a0af25d10179fd6c06e4a7113ec83d (diff)
moc: Fix asserts on moc on empty token preceding ## operator
Regression introduced in c32ef0a725c7ac9d8a9ab053407389ef2fddc64e The expansion vector can be empty, in that case it is not allowed to call constLast() Task-number: QTBUG-55853 Change-Id: I47aa8eb7507ee91662215df42b4a66eebaa32bb5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/tools/moc/parse-defines.h3
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/parse-defines.h b/tests/auto/tools/moc/parse-defines.h
index 9fb5da4b07..6100bf67ad 100644
--- a/tests/auto/tools/moc/parse-defines.h
+++ b/tests/auto/tools/moc/parse-defines.h
@@ -139,6 +139,9 @@ public slots:
signals:
DEFINE_CMDLINE_SIGNAL;
+#define QTBUG55853(X) PD_DEFINE1(X, signalQTBUG55853)
+#define PD_EMPTY /* empty */
+ void QTBUG55853(PD_EMPTY)();
};
#undef QString
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index a3648c95b6..601b1bb36b 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -3397,6 +3397,9 @@ void tst_Moc::parseDefines()
index = mo->indexOfSignal("cmdlineSignal(QMap<int,int>)");
QVERIFY(index != -1);
+
+ index = mo->indexOfSignal("signalQTBUG55853()");
+ QVERIFY(index != -1);
}
void tst_Moc::preprocessorOnly()