summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-08-01 19:01:48 -0500
committerThiago Macieira <thiago.macieira@intel.com>2014-09-23 17:44:22 +0200
commitd554fa6fdcff40e38ab7fcfbd1249e25b89a8078 (patch)
tree0889c5f628c261a7be55b75dc2d6ace8f2694b59 /tests
parent86922b4655844cc771512c9dee9822c1055dfd77 (diff)
Add unit tests for cleaning up nested functions
I think supporting them now is too complex for the Qt code. We would probably need to rewrite the parser using a tokenizer so we can find the right name of the function. Just skipping backwards breaks the support for returning function pointers and PMFs. Change-Id: I78636437ecd46d77e6b9b013b2f2668cca1b6cd6 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/global/qlogging/tst_qlogging.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
index ebfab643bd..0e35b28fda 100644
--- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
+++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp
@@ -242,6 +242,19 @@ public:
int &operator--() { ADD("TestClass1::operator--"); return x; }
int operator--(int) { ADD("TestClass1::operator--"); return 0; }
+ int nested_struct()
+ {
+ struct Nested { void nested() { ADD("TestClass1::nested_struct"); } };
+ Nested().nested();
+ return 0;
+ }
+ int nested_struct_const() const
+ {
+ struct Nested { void nested() { ADD("TestClass1::nested_struct_const"); } };
+ Nested().nested();
+ return 0;
+ }
+
#ifdef Q_COMPILER_REF_QUALIFIERS
int lvalue() & { ADD("TestClass1::lvalue"); return 0; }
int const_lvalue() const & { ADD("TestClass1::const_lvalue"); return 0; }
@@ -308,6 +321,9 @@ public:
operator--();
operator--(0);
+ nested_struct();
+ nested_struct_const();
+
#ifdef Q_COMPILER_REF_QUALIFIERS
lvalue();
const_lvalue();
@@ -678,6 +694,8 @@ void tst_qmessagehandler::cleanupFuncinfo()
// qDebug() << funcinfo.toLatin1();
QByteArray result = qCleanupFuncinfo(funcinfo.toLatin1());
+ QEXPECT_FAIL("TestClass1::nested_struct", "Nested function processing is broken", Continue);
+ QEXPECT_FAIL("TestClass1::nested_struct_const", "Nested function processing is broken", Continue);
QTEST(QString::fromLatin1(result), "expected");
}
#endif