Fix broken CI caused by my qt fix

This commit is contained in:
Daniel Marjamäki 2022-09-08 11:12:38 +02:00
parent d46ea7ba86
commit 92845295b8
3 changed files with 10 additions and 1 deletions

View File

@ -9076,7 +9076,9 @@ void Tokenizer::simplifyQtSignalsSlots()
{ {
if (isC()) if (isC())
return; return;
if (std::none_of(mSettings->libraries.cbegin(), mSettings->libraries.cend(), [](const std::string& lib) { return lib == "qt";})) if (std::none_of(mSettings->libraries.cbegin(), mSettings->libraries.cend(), [](const std::string& lib) {
return lib == "qt";
}))
return; return;
for (Token *tok = list.front(); tok; tok = tok->next()) { for (Token *tok = list.front(); tok; tok = tok->next()) {
// check for emit which can be outside of class // check for emit which can be outside of class

View File

@ -5893,12 +5893,14 @@ private:
} }
void findFunction11() { void findFunction11() {
settings1.libraries.emplace_back("qt");
GET_SYMBOL_DB("class Fred : public QObject {\n" GET_SYMBOL_DB("class Fred : public QObject {\n"
" Q_OBJECT\n" " Q_OBJECT\n"
"private slots:\n" "private slots:\n"
" void foo();\n" " void foo();\n"
"};\n" "};\n"
"void Fred::foo() { }"); "void Fred::foo() { }");
settings1.libraries.pop_back();
ASSERT_EQUALS("", errout.str()); ASSERT_EQUALS("", errout.str());
const Token *f = Token::findsimplematch(tokenizer.tokens(), "foo ( ) {"); const Token *f = Token::findsimplematch(tokenizer.tokens(), "foo ( ) {");

View File

@ -57,6 +57,11 @@ private:
settings2.checkUnusedTemplates = true; settings2.checkUnusedTemplates = true;
settings_windows.checkUnusedTemplates = true; settings_windows.checkUnusedTemplates = true;
// library=qt
settings0.libraries.emplace_back("qt");
settings1.libraries.emplace_back("qt");
settings2.libraries.emplace_back("qt");
TEST_CASE(tokenize1); TEST_CASE(tokenize1);
TEST_CASE(tokenize2); TEST_CASE(tokenize2);
TEST_CASE(tokenize4); TEST_CASE(tokenize4);