| 7206 | } |
| 7207 | |
| 7208 | void findFunction3() { |
| 7209 | GET_SYMBOL_DB("struct base { void foo() { } };\n" |
| 7210 | "struct derived : public base { void foo() { } };\n" |
| 7211 | "void foo() {\n" |
| 7212 | " derived d;\n" |
| 7213 | " d.foo();\n" |
| 7214 | "}"); |
| 7215 | |
| 7216 | const Token *callfunc = Token::findsimplematch(tokenizer.tokens(), "d . foo ( ) ;"); |
| 7217 | ASSERT_EQUALS("", errout_str()); |
| 7218 | ASSERT_EQUALS(true, db != nullptr); // not null |
| 7219 | ASSERT_EQUALS(true, callfunc != nullptr); // not null |
| 7220 | ASSERT_EQUALS(true, callfunc && callfunc->tokAt(2)->function() && callfunc->tokAt(2)->function()->tokenDef->linenr() == 2); // should find function on line 2 |
| 7221 | } |
| 7222 | |
| 7223 | void findFunction4() { |
| 7224 | GET_SYMBOL_DB("void foo(UNKNOWN) { }\n" |
nothing calls this directly
no test coverage detected