From 5c8df5fa4ec4a8f30261dc4d53a810f7be65df51 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 16 Dec 2013 16:02:45 +0100 Subject: CppEditor/CppTools: Introduce Test{Case,Document} Move common functionality of the 12 test classes into base classes. Change-Id: If64d3cec876807ac6f991151189860a99b8ff4ca Reviewed-by: Erik Verbruggen --- src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp') diff --git a/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp b/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp index cddb4d0db2..458b9d2fb8 100644 --- a/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp +++ b/src/plugins/cpptools/cpppointerdeclarationformatter_test.cpp @@ -27,9 +27,10 @@ ** ****************************************************************************/ -#include "cpptoolsplugin.h" #include "cpppointerdeclarationformatter.h" #include "cpptoolsplugin.h" +#include "cpptoolsplugin.h" +#include "cpptoolstestcase.h" #include @@ -63,8 +64,9 @@ static QString stripCursor(const QString &source) return copy; } -struct TestEnvironment +class TestEnvironment : public CppTools::Tests::TestCase { +public: QByteArray source; Snapshot snapshot; CppRefactoringFilePtr cppRefactoringFile; @@ -88,9 +90,7 @@ struct TestEnvironment // Write source to temprorary file const QString filePath = QDir::tempPath() + QLatin1String("/file.h"); document = Document::create(filePath); - Utils::FileSaver documentSaver(document->fileName()); - documentSaver.write(sourceWithoutCursorMarker.toLatin1()); - documentSaver.finalize(); + QVERIFY(writeFile(document->fileName(), sourceWithoutCursorMarker.toLatin1())); // Preprocess source Preprocessor preprocess(0, &env); -- cgit v1.2.1