Cpp{Tools,Editor}: Expect UTF-8 encoded literals

Change-Id: I9843c4163aad3fa3f1bfa33060c76328fc2dc25a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-05-05 11:43:24 -04:00
parent cadc4b42ba
commit bea8fc8e6a
14 changed files with 163 additions and 29 deletions

View File

@@ -89,7 +89,7 @@ public:
// Write source to temprorary file
const QString filePath = QDir::tempPath() + QLatin1String("/file.h");
Document::Ptr document = Document::create(filePath);
QVERIFY(writeFile(document->fileName(), sourceWithoutCursorMarker.toLatin1()));
QVERIFY(writeFile(document->fileName(), sourceWithoutCursorMarker.toUtf8()));
// Preprocess source
Environment env;
@@ -145,7 +145,7 @@ void CppToolsPlugin::test_format_pointerdeclaration_in_simpledeclarations()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
PointerDeclarationFormatterTestCase(source.toUtf8(),
reformattedSource,
Document::ParseDeclaration,
PointerDeclarationFormatter::RespectCursor);
@@ -369,7 +369,7 @@ void CppToolsPlugin::test_format_pointerdeclaration_in_controlflowstatements()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
PointerDeclarationFormatterTestCase(source.toUtf8(),
reformattedSource,
Document::ParseStatement,
PointerDeclarationFormatter::RespectCursor);
@@ -444,7 +444,7 @@ void CppToolsPlugin::test_format_pointerdeclaration_multiple_declarators()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
PointerDeclarationFormatterTestCase(source.toUtf8(),
reformattedSource,
Document::ParseDeclaration,
PointerDeclarationFormatter::RespectCursor);
@@ -499,7 +499,7 @@ void CppToolsPlugin::test_format_pointerdeclaration_multiple_matches()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
PointerDeclarationFormatterTestCase(source.toUtf8(),
reformattedSource,
Document::ParseTranlationUnit,
PointerDeclarationFormatter::IgnoreCursor);
@@ -582,7 +582,7 @@ void CppToolsPlugin::test_format_pointerdeclaration_macros()
QFETCH(QString, source);
QFETCH(QString, reformattedSource);
PointerDeclarationFormatterTestCase(source.toLatin1(),
PointerDeclarationFormatterTestCase(source.toUtf8(),
reformattedSource,
Document::ParseTranlationUnit,
PointerDeclarationFormatter::RespectCursor);