Symbol database: Added TODO test case for #3190

This commit is contained in:
Daniel Marjamäki 2012-09-15 20:13:32 +02:00
parent 295ba9cc4f
commit ae7ee5ffd3
1 changed files with 19 additions and 0 deletions

View File

@ -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<Scope>::const_iterator scope = db->scopeList.begin(); scope != db->scopeList.end(); ++scope) {
for (std::list<Function>::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<int, string> foo() {}")