CppEditor: Proliferate FilePath use

This includes one functional change: It drops some cleaning
of the path used to create the CppDocument, which is now
assumed to be done on the caller side.

Change-Id: I5e2a182028e4d5b56282ad85f4a5c665f081754f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
hjk
2022-11-23 10:28:47 +01:00
parent 8d645a506d
commit 9d80e23256
23 changed files with 61 additions and 52 deletions

View File

@@ -1,4 +1,4 @@
add_qtc_test(tst_cplusplus_cxx11
DEPENDS CppEditor
DEPENDS CppEditor Utils
SOURCES tst_cxx11.cpp
)

View File

@@ -12,6 +12,7 @@
//TESTED_COMPONENT=src/libs/cplusplus
using namespace CPlusPlus;
using namespace Utils;
#define VERIFY_ERRORS() \
do { \
@@ -113,7 +114,7 @@ class tst_cxx11: public QObject
Document::Ptr document(const QString &fileName, QByteArray *errors = 0, bool c99Enabled = false)
{
Document::Ptr doc = Document::create(fileName);
Document::Ptr doc = Document::create(FilePath::fromString(fileName));
QFile file(testdata(fileName));
if (file.open(QFile::ReadOnly)) {
LanguageFeatures features;
@@ -274,7 +275,7 @@ void tst_cxx11::lambdaType()
features.cxxEnabled = true;
QByteArray errors;
Document::Ptr doc = Document::create(QLatin1String("testFile"));
Document::Ptr doc = Document::create(FilePath::fromPathPart(u"testFile"));
processDocument(doc, source.toUtf8(), features, &errors);
const bool hasErrors = !errors.isEmpty();