aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-08-27 16:07:26 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-08-31 09:15:50 +0000
commit1652396ece844718e3fcbfbc04a6f68bdb64e695 (patch)
tree2a223a9c1e542ebed5d28cd0a2626c7512673347 /tests/auto
parentb3652da3acb6177115214341cf2793e1347602f7 (diff)
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>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp b/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp
index 45f713a88c..6432e1d66b 100644
--- a/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp
+++ b/tests/auto/cplusplus/cppselectionchanger/tst_cppselectionchangertest.cpp
@@ -208,7 +208,7 @@ void tst_CppSelectionChanger::initTestCase()
// Read cpp file contents into QTextDocument and CppTools::Document::Ptr.
QString fileName(SRCDIR "/testCppFile.cpp");
QFile file(fileName);
- file.open(QIODevice::ReadOnly);
+ file.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream s(&file);
cppFileString = s.readAll();
file.close();