diff options
author | hjk <hjk@qt.io> | 2022-11-23 10:28:47 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-11-24 15:54:33 +0000 |
commit | 9d80e23256ea139e4ae90187bd8872e6a1fb3a75 (patch) | |
tree | ea7a5b9fe86757e9970d5ffab2d48614e84972da /tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp | |
parent | 8d645a506de17b989259fd90ea4e382e06fbeab6 (diff) | |
download | qt-creator-9d80e23256ea139e4ae90187bd8872e6a1fb3a75.tar.gz |
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>
Diffstat (limited to 'tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp')
-rw-r--r-- | tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp b/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp index 5b098c136e..1d690da849 100644 --- a/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp +++ b/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp @@ -9,11 +9,14 @@ #include <cplusplus/TranslationUnit.h> #include <cplusplus/pp-engine.h> +#include <utils/filepath.h> + #include <QtTest> #include <QTextDocument> using namespace CPlusPlus; using namespace CppEditor; +using namespace Utils; //TESTED_COMPONENT=src/plugins/cppeditor @@ -175,7 +178,7 @@ inline void tst_CppSelectionChanger::doShrink(QTextCursor& cursor, const QString QByteArray tst_CppSelectionChanger::preprocess(const QByteArray &source, const QString &fileName) { Client *client = 0; // no client. - Environment env; + CPlusPlus::Environment env; Preprocessor preprocess(client, &env); preprocess.setKeepComments(true); return preprocess.run(fileName, source); @@ -193,7 +196,7 @@ void tst_CppSelectionChanger::initTestCase() textDocument.setPlainText(cppFileString); // Create the CPP document and preprocess the source, just like how the CppEditor does it. - cppDocument = Document::create(fileName); + cppDocument = Document::create(FilePath::fromString(fileName)); const QByteArray preprocessedSource = preprocess(cppFileString.toUtf8(), fileName); cppDocument->setUtf8Source(preprocessedSource); cppDocument->parse(); |