Commit a0ae1a7b authored by Igor Kushnir's avatar Igor Kushnir
Browse files

clang-format TestProblems::testMissingInclude_data()

parent 2aaaed16
......@@ -308,32 +308,44 @@ void TestProblems::testMissingInclude_data()
QTest::addColumn<QString>("dummyFileName");
QTest::addColumn<QVector<ClangFixit>>("fixits");
QTest::newRow("basic")
<< "class A {};\n"
<< "int main() { A a; }\n"
<< QString()
<< QVector<ClangFixit>{
ClangFixit{"class A;\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(0, 0, 0, 0)), QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(0, 0, 0, 0)), QString(), QString()}
};
QTest::newRow("basic") << "class A {};\n"
<< "int main() { A a; }\n"
<< QString()
<< QVector<ClangFixit>{
ClangFixit{"class A;\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(0, 0, 0, 0)),
QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(0, 0, 0, 0)),
QString(), QString()}};
// cf. bug 375274
QTest::newRow("ignore-moc-at-end")
<< "class Foo {};\n"
<< "#include <vector>\nint main() { Foo foo; }\n#include \"dummyInclude\"\n"
<< "/moc_fooXXXXXX.cpp"
<< QVector<ClangFixit>{
ClangFixit{"class Foo;\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(0, 0, 0, 0)), QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(1, 0, 1, 0)), QString(), QString()}
};
<< QVector<ClangFixit>{ClangFixit{"class Foo;\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(0, 0, 0, 0)),
QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(1, 0, 1, 0)),
QString(), QString()}};
QTest::newRow("ignore-moc-at-end2")
<< "class Foo {};\n"
<< "int main() { Foo foo; }\n#include \"dummyInclude\"\n"
<< "/fooXXXXXX.moc"
<< QVector<ClangFixit>{
ClangFixit{"class Foo;\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(0, 0, 0, 0)), QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n", DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"), KTextEditor::Range(0, 0, 0, 0)), QString(), QString()}
};
<< QVector<ClangFixit>{ClangFixit{"class Foo;\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(0, 0, 0, 0)),
QString(), QString()},
ClangFixit{"#include \"includeFile.h\"\n",
DocumentRange(IndexedString(QDir::tempPath() + "/workingFile.h"),
KTextEditor::Range(0, 0, 0, 0)),
QString(), QString()}};
}
struct ExpectedTodo
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment