From ae7ee5ffd38a589be2a0e83120890ac93ad2dbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 15 Sep 2012 20:13:32 +0200 Subject: [PATCH] Symbol database: Added TODO test case for #3190 --- test/testsymboldatabase.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index b9b34552e..5f03a9b1a 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -99,6 +99,7 @@ private: TEST_CASE(hasInlineClassFunctionReturningFunctionPointer); TEST_CASE(hasMissingInlineClassFunctionReturningFunctionPointer); TEST_CASE(hasClassFunctionReturningFunctionPointer); + TEST_CASE(hasSubClassConstructor); TEST_CASE(functionDeclarationTemplate); TEST_CASE(functionDeclarations); @@ -657,6 +658,24 @@ private: } } + void hasSubClassConstructor() { + GET_SYMBOL_DB("class Foo { class Sub; }; class Foo::Sub { Sub() {} };"); + ASSERT(db); + + if (db) { + bool seen_something = false; + for (std::list::const_iterator scope = db->scopeList.begin(); scope != db->scopeList.end(); ++scope) { + for (std::list::const_iterator func = scope->functionList.begin(); func != scope->functionList.end(); ++func) { + ASSERT_EQUALS("Sub", func->token->str()); + ASSERT_EQUALS(true, func->hasBody); + ASSERT_EQUALS(Function::eConstructor, func->type); + seen_something = true; + } + } + TODO_ASSERT_EQUALS("works", "doesn't work", seen_something ? "works" : "doesn't work"); + } + } + void functionDeclarationTemplate() { GET_SYMBOL_DB("std::map foo() {}")