summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppsourceprocessor_test.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@digia.com>2014-06-13 12:59:24 -0400
committerNikolai Kosjar <nikolai.kosjar@digia.com>2014-06-16 14:44:24 +0200
commitcfe3c0be34b63f8c4326f2d01cf880f6c28c9eb5 (patch)
treedd1d49568528bd574e110a0ba5292781fb3a636a /src/plugins/cpptools/cppsourceprocessor_test.cpp
parent9acdb0bd3509bd62a4cb1811614af6a131f39b32 (diff)
downloadqt-creator-cfe3c0be34b63f8c4326f2d01cf880f6c28c9eb5.tar.gz
CppTools: Remove test file after test
In test_includeGroups_detectIncludeGroupsByIncludeType the test file was not removed and thus subsequent and isolated executions of this test failed. Change-Id: I5eeb4f004f5b146ac794ca913b4092629131fca3 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor_test.cpp')
-rw-r--r--src/plugins/cpptools/cppsourceprocessor_test.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor_test.cpp b/src/plugins/cpptools/cppsourceprocessor_test.cpp
index 73a3754f44..a0b4022682 100644
--- a/src/plugins/cpptools/cppsourceprocessor_test.cpp
+++ b/src/plugins/cpptools/cppsourceprocessor_test.cpp
@@ -64,17 +64,16 @@ public:
Document::Ptr run(const QByteArray &source)
{
const QString fileName = TestIncludePaths::testFilePath();
- if (QFileInfo(fileName).exists())
- return Document::Ptr(); // Test file was not removed.
- TestCase::writeFile(fileName, source);
+ FileWriterAndRemover scopedFile(fileName, source);
+ if (!scopedFile.writtenSuccessfully())
+ return Document::Ptr();
CppSourceProcessor sourceProcessor((QPointer<CppModelManager>(m_cmm)));
sourceProcessor.setIncludePaths(QStringList(TestIncludePaths::directoryOfTestFile()));
sourceProcessor.run(fileName);
Document::Ptr document = m_cmm->document(fileName);
- QFile(fileName).remove();
return document;
}