Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KDevelop
KDevelop
Commits
a0ae1a7b
Commit
a0ae1a7b
authored
Oct 11, 2022
by
Igor Kushnir
Browse files
clang-format TestProblems::testMissingInclude_data()
parent
2aaaed16
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/clang/tests/test_problems.cpp
View file @
a0ae1a7b
...
...
@@ -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>
\n
int 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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment