forked from qt-creator/qt-creator
CppTools: Fix CppSelectionChanger autotest
... on Windows. We need to open the test file in text mode. Otherwise the raw string literal will contain carriage returns. As these get dropped by QTextDocument, the offsets will be inconsistent with the ones reported by the tokens, causing the test to fail. Change-Id: I161a3f5791c33416ff732f90fd615cf39d8152ce Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -208,7 +208,7 @@ void tst_CppSelectionChanger::initTestCase()
|
|||||||
// Read cpp file contents into QTextDocument and CppTools::Document::Ptr.
|
// Read cpp file contents into QTextDocument and CppTools::Document::Ptr.
|
||||||
QString fileName(SRCDIR "/testCppFile.cpp");
|
QString fileName(SRCDIR "/testCppFile.cpp");
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
file.open(QIODevice::ReadOnly);
|
file.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||||
QTextStream s(&file);
|
QTextStream s(&file);
|
||||||
cppFileString = s.readAll();
|
cppFileString = s.readAll();
|
||||||
file.close();
|
file.close();
|
||||||
|
Reference in New Issue
Block a user