diff options
Diffstat (limited to 'src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp')
-rw-r--r-- | src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp b/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp index 7ab12f77a2..9ac573c38d 100644 --- a/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp +++ b/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp @@ -87,15 +87,18 @@ 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.toUtf8())); + Tests::TemporaryDir temporaryDir; + QVERIFY(temporaryDir.isValid()); + const QString filePath = temporaryDir.createFile("file.h", + sourceWithoutCursorMarker.toUtf8()); + QVERIFY(!filePath.isEmpty()); // Preprocess source Environment env; Preprocessor preprocess(0, &env); const QByteArray preprocessedSource = preprocess.run(filePath, sourceWithoutCursorMarker); + Document::Ptr document = Document::create(filePath); document->setUtf8Source(preprocessedSource); document->parse(parseMode); document->check(); |