aboutsummaryrefslogtreecommitdiffstats
path: root/tests/incorrect-emit
diff options
context:
space:
mode:
authorSergio Martins <smartins@kde.org>2017-03-04 01:30:41 +0000
committerSergio Martins <smartins@kde.org>2017-03-04 01:30:41 +0000
commit6d83b9398776eaa15505f496c5f7161a464c476e (patch)
treede81f453036ad68a8f0b0662e5f553feaa05f8d1 /tests/incorrect-emit
parenta7a4158d48b1c6f764982dff1cccea6817585aa0 (diff)
incorrect-emit: Add failing unit-test for bug 377140
CCBUG: 377140
Diffstat (limited to 'tests/incorrect-emit')
-rw-r--r--tests/incorrect-emit/bug377140.cpp30
-rw-r--r--tests/incorrect-emit/bug377140.cpp.expected0
-rw-r--r--tests/incorrect-emit/config.json8
3 files changed, 36 insertions, 2 deletions
diff --git a/tests/incorrect-emit/bug377140.cpp b/tests/incorrect-emit/bug377140.cpp
new file mode 100644
index 00000000..9043b911
--- /dev/null
+++ b/tests/incorrect-emit/bug377140.cpp
@@ -0,0 +1,30 @@
+#include <QtCore/QObject>
+
+class TestBugNew : public QObject
+{
+ Q_OBJECT
+
+Q_SIGNALS:
+ void someSignal();
+
+protected:
+ void protectedMethod(); // Needed to triggers the bug
+};
+
+// Needed to trigger the bug
+void TestBugNew::someSignal()
+{
+}
+
+// include subclass moc file which includes header of subclass with inline method using signal
+class SubTestBugNew : public TestBugNew
+{
+ Q_OBJECT
+public:
+ void otherMethod();
+};
+
+void SubTestBugNew::otherMethod()
+{
+ emit someSignal(); // OK
+}
diff --git a/tests/incorrect-emit/bug377140.cpp.expected b/tests/incorrect-emit/bug377140.cpp.expected
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/tests/incorrect-emit/bug377140.cpp.expected
diff --git a/tests/incorrect-emit/config.json b/tests/incorrect-emit/config.json
index f88cbf0c..6ccc022c 100644
--- a/tests/incorrect-emit/config.json
+++ b/tests/incorrect-emit/config.json
@@ -1,8 +1,12 @@
{
+ "minimum_clang_version" : 370,
"tests" : [
{
- "filename" : "main.cpp",
- "minimum_clang_version" : 370
+ "filename" : "main.cpp"
+ },
+ {
+ "filename" : "bug377140.cpp",
+ "expects_failure" : true
}
]
}