CppEditor: Add basic test for ExtractFunction

Change-Id: I44f2edb2905e202669630ab5da85066011491fae
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-03-12 16:25:45 +01:00
parent 251b444cfd
commit 6a94f7e355
7 changed files with 122 additions and 12 deletions

View File

@@ -34,11 +34,12 @@
#include "cppquickfix.h"
#include <cpptools/cpprefactoringchanges.h>
#include <extensionsystem/iplugin.h>
#include <QDialog>
#include <functional>
QT_BEGIN_NAMESPACE
class QByteArray;
template <class> class QList;
@@ -435,7 +436,13 @@ public:
class ExtractFunction : public CppQuickFixFactory
{
public:
typedef std::function<QString ()> FunctionNameGetter;
ExtractFunction(FunctionNameGetter functionNameGetter = FunctionNameGetter());
void match(const CppQuickFixInterface &interface, TextEditor::QuickFixOperations &result);
private:
FunctionNameGetter m_functionNameGetter; // For tests to avoid GUI pop-up.
};
/*!