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
1494a5cc
Commit
1494a5cc
authored
Oct 11, 2022
by
Igor Kushnir
Browse files
Deduplicate a path string in TestProblems::testMissingInclude_data()
parent
a0ae1a7b
Pipeline
#251048
canceled with stage
in 49 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
plugins/clang/tests/test_problems.cpp
View file @
1494a5cc
...
...
@@ -308,17 +308,17 @@ void TestProblems::testMissingInclude_data()
QTest
::
addColumn
<
QString
>
(
"dummyFileName"
);
QTest
::
addColumn
<
QVector
<
ClangFixit
>>
(
"fixits"
);
const
QString
workingFile
=
QDir
::
tempPath
()
+
"/workingFile.h"
;
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
)),
DocumentRange
(
IndexedString
(
workingFile
),
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
)),
DocumentRange
(
IndexedString
(
workingFile
),
KTextEditor
::
Range
(
0
,
0
,
0
,
0
)),
QString
(),
QString
()}};
// cf. bug 375274
...
...
@@ -327,24 +327,20 @@ void TestProblems::testMissingInclude_data()
<<
"#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
)),
DocumentRange
(
IndexedString
(
workingFile
),
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
)),
DocumentRange
(
IndexedString
(
workingFile
),
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
)),
DocumentRange
(
IndexedString
(
workingFile
),
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
)),
DocumentRange
(
IndexedString
(
workingFile
),
KTextEditor
::
Range
(
0
,
0
,
0
,
0
)),
QString
(),
QString
()}};
}
...
...
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